liangfu commented on a change in pull request #7680:
URL: https://github.com/apache/tvm/pull/7680#discussion_r602141479



##########
File path: apps/android_rpc/app/src/main/jni/CMakeLists.txt
##########
@@ -0,0 +1,51 @@
+cmake_minimum_required(VERSION 3.4.1)
+
+add_library(
+        tvm4j_runtime_packed
+     
+        SHARED
+
+        IMPORTED
+        )
+
+if(${ANDROID_ABI} STREQUAL "arm64-v8a")
+    set_target_properties(
+        tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+        ${CMAKE_SOURCE_DIR}/../obj/local/arm64-v8a/libtvm4j_runtime_packed.so
+
+)
+
+elseif(${ANDROID_ABI} STREQUAL "armeabi-v7a")
+    set_target_properties(
+            tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+            
${CMAKE_SOURCE_DIR}/../obj/local/armeabi-v7a/libtvm4j_runtime_packed.so
+
+    )
+
+elseif(${ANDROID_ABI} STREQUAL "x86")
+set_target_properties(
+        tvm4j_runtime_packed
+
+        PROPERTIES IMPORTED_LOCATION
+
+        ${CMAKE_SOURCE_DIR}/../obj/local/x86/libtvm4j_runtime_packed.so
+
+)    
+
+elseif(${ANDROID_ABI} STREQUAL "x86_64")
+    set_target_properties(
+            tvm4j_runtime_packed

Review comment:
       please keep indentation consistent.

##########
File path: apps/android_rpc/app/build.gradle
##########
@@ -35,17 +35,31 @@ android {
         versionCode 1
         versionName "1.0"
         testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
+
+        externalNativeBuild{
+            cmake {
+                abiFilters "arm64-v8a", "armeabi-v7a","x86","x86_64"
+            }
+        }
+    

Review comment:
       please remove extra blank lines.

##########
File path: apps/android_rpc/app/src/main/jni/CMakeLists.txt
##########
@@ -0,0 +1,51 @@
+cmake_minimum_required(VERSION 3.4.1)
+
+add_library(
+        tvm4j_runtime_packed
+     
+        SHARED
+
+        IMPORTED
+        )
+
+if(${ANDROID_ABI} STREQUAL "arm64-v8a")
+    set_target_properties(
+        tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+        ${CMAKE_SOURCE_DIR}/../obj/local/arm64-v8a/libtvm4j_runtime_packed.so
+
+)
+
+elseif(${ANDROID_ABI} STREQUAL "armeabi-v7a")
+    set_target_properties(
+            tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+            
${CMAKE_SOURCE_DIR}/../obj/local/armeabi-v7a/libtvm4j_runtime_packed.so
+
+    )
+
+elseif(${ANDROID_ABI} STREQUAL "x86")
+set_target_properties(
+        tvm4j_runtime_packed
+
+        PROPERTIES IMPORTED_LOCATION
+
+        ${CMAKE_SOURCE_DIR}/../obj/local/x86/libtvm4j_runtime_packed.so
+
+)    
+
+elseif(${ANDROID_ABI} STREQUAL "x86_64")
+    set_target_properties(
+            tvm4j_runtime_packed
+
+            PROPERTIES IMPORTED_LOCATION
+
+            ${CMAKE_SOURCE_DIR}/../obj/local/x86_64/libtvm4j_runtime_packed.so
+
+    )
+
+endif()

Review comment:
       please add newline at EOF

##########
File path: apps/android_rpc/app/src/main/jni/CMakeLists.txt
##########
@@ -0,0 +1,51 @@
+cmake_minimum_required(VERSION 3.4.1)
+
+add_library(
+        tvm4j_runtime_packed
+     

Review comment:
       please remove extra blank lines, and some similar ones in the following.

##########
File path: 
apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/MainActivity.java
##########
@@ -69,6 +69,7 @@ public Intent updateRPCPrefs() {
     editor.putString("input_key", key);
     editor.putBoolean("input_switch", isChecked);
     editor.commit();
+    

Review comment:
       remove extra blank lines.

##########
File path: apps/android_rpc/app/.gitignore
##########
@@ -1 +1,7 @@
 /build
+/.externalNativeBuild
+/src/main/jni/org_apache_tvm_native_c_api.h
+/src/main/jni/org_apache_tvm_native_c_api.cc
+/src/main/jni/jni_helper_func.h
+/src/main/obj
+/libs

Review comment:
       please add newline at EOF

##########
File path: apps/android_rpc/app/build.gradle
##########
@@ -35,17 +35,31 @@ android {
         versionCode 1
         versionName "1.0"
         testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
+
+        externalNativeBuild{
+            cmake {
+                abiFilters "arm64-v8a", "armeabi-v7a","x86","x86_64"
+            }
+        }
+    
+
     }
     buildTypes {
         release {
             minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
         }
     }
-    sourceSets {
-        main {
-            jni.srcDirs = []
-            jniLibs.srcDirs = ['src/main/libs']
+    externalNativeBuild{
+        cmake {
+                path "src/main/jni/CMakeLists.txt"
+            }
+    
+        sourceSets {
+            main {
+                jni.srcDirs = []
+                //jniLibs.srcDirs = ['src/main/libs']

Review comment:
       please remove unused code.

##########
File path: apps/android_rpc/.gitignore
##########
@@ -6,4 +6,7 @@
 .DS_Store
 /build
 /captures
-.externalNativeBuild
+/.idea
+/gradlew
+/gradlew.bat
+/gradle

Review comment:
       please add newline at EOF




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to