This is an automated email from the ASF dual-hosted git repository.
tqchen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git
The following commit(s) were added to refs/heads/master by this push:
new ef50c0e Fix android runtime error (#6575)
ef50c0e is described below
commit ef50c0ee01749fb1ee243b6048eff51afac77397
Author: eric <[email protected]>
AuthorDate: Tue Sep 29 00:26:56 2020 +0900
Fix android runtime error (#6575)
codes for USE_RANDOM in tvm4j was missing.
---
apps/android_rpc/app/src/main/jni/Application.mk | 4 ++++
apps/android_rpc/app/src/main/jni/make/config.mk | 3 +++
apps/android_rpc/app/src/main/jni/tvm_runtime.h | 4 ++++
3 files changed, 11 insertions(+)
diff --git a/apps/android_rpc/app/src/main/jni/Application.mk
b/apps/android_rpc/app/src/main/jni/Application.mk
index 54abdf7..5f885f1 100644
--- a/apps/android_rpc/app/src/main/jni/Application.mk
+++ b/apps/android_rpc/app/src/main/jni/Application.mk
@@ -44,3 +44,7 @@ endif
ifeq ($(USE_SORT), 1)
APP_CPPFLAGS += -DUSE_SORT=1
endif
+
+ifeq ($(USE_RANDOM), 1)
+ APP_CPPFLAGS += -DUSE_RANDOM=1
+endif
diff --git a/apps/android_rpc/app/src/main/jni/make/config.mk
b/apps/android_rpc/app/src/main/jni/make/config.mk
index 49e3326..851430c 100644
--- a/apps/android_rpc/app/src/main/jni/make/config.mk
+++ b/apps/android_rpc/app/src/main/jni/make/config.mk
@@ -42,6 +42,9 @@ USE_VULKAN = 0
# whether to enable contrib sort functions during compile
USE_SORT = 1
+# whether to eanble contrib random functions during compile
+USE_RANDOM = 1
+
ifeq ($(USE_VULKAN), 1)
# Statically linking vulkan requires API Level 24 or higher
APP_PLATFORM = android-24
diff --git a/apps/android_rpc/app/src/main/jni/tvm_runtime.h
b/apps/android_rpc/app/src/main/jni/tvm_runtime.h
index b69b259..8a432be 100644
--- a/apps/android_rpc/app/src/main/jni/tvm_runtime.h
+++ b/apps/android_rpc/app/src/main/jni/tvm_runtime.h
@@ -73,6 +73,10 @@
#include "../src/runtime/contrib/sort/sort.cc"
#endif
+#ifdef USE_RANDOM
+#include "../src/runtime/contrib/random/random.cc"
+#endif
+
#include <android/log.h>
void dmlc::CustomLogMessage::Log(const std::string& msg) {