• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From b9195df86090c2b3b5ef6f0f320fb9262c952d01 Mon Sep 17 00:00:00 2001
2From: Zhu Guodong <zhuguodong0001@163.com>
3Date: Mon, 10 Jul 2023 11:20:41 +0800
4Subject: [PATCH] auto-apply 0034-splite-ndk-so.patch
5
6---
7 mindspore/lite/BUILD.gn | 61 ++++++++++++++++++++++++++++++++++++++---
8 1 file changed, 57 insertions(+), 4 deletions(-)
9
10diff --git a/mindspore/lite/BUILD.gn b/mindspore/lite/BUILD.gn
11index cf0a74ab..92ace734 100644
12--- a/mindspore/lite/BUILD.gn
13+++ b/mindspore/lite/BUILD.gn
14@@ -68,9 +68,9 @@ import("//build/ohos.gni")
15 ohos_group("mindspore") {
16   deps = [
17     ":mindspore_lib",
18+    ":mindspore_ndk",
19     ":mindspore_train_lib",
20     "mindir:mindir_lib",
21-    "tools/benchmark:benchmark_bin",
22     "src/runtime/js_api:mindsporelite_napi"
23   ]
24 }
25@@ -181,7 +181,6 @@ lite_mindrt_sources = [
26 ]
27
28 all_lite_sources += cxx_api_sources
29-all_lite_sources += c_api_sources
30 all_lite_sources += api_source
31 all_lite_sources += control_flow_kernel_sources
32 all_lite_sources += experimental_sources
33@@ -749,7 +748,7 @@ ohos_shared_library("mindspore_lib") {
34
35   external_deps = [ "hilog:libhilog" ]
36
37-  output_name = "libmindspore-lite.huawei"
38+  output_name = "libmindspore-lite"
39   output_extension = "so"
40   innerapi_tags = [ "platformsdk"]
41   SUPPORT_NNRT = true
42@@ -760,7 +759,6 @@ ohos_shared_library("mindspore_lib") {
43       "src/runtime/delegate/nnrt/nnrt_model_kernel.cc",
44     ]
45     include_dirs += [
46-      "//foundation/ai/neural_network_runtime",
47       "src/delegate/nnrt/include",
48       "../../mindspore/core/ir",
49       "mindir/include",
50@@ -784,6 +782,61 @@ ohos_shared_library("mindspore_lib") {
51   subsystem_name = "thirdparty"
52 }
53
54+# NDK lib
55+ohos_shared_library("mindspore_ndk") {
56+  deps = [
57+    ":mindspore_lib"
58+  ]
59+
60+  sources = c_api_sources
61+
62+  include_dirs = [
63+    "//third_party/flatbuffers/include",
64+    "./",
65+    "../",
66+    "../../",
67+    "../core",
68+    "src",
69+    "src/c_api/",
70+    "../ccsrc/plugin/device/cpu/kernel/",
71+    "../core/mindrt/src/",
72+    "../core/mindrt/include/",
73+    "../../third_party/",
74+    "./schema/",
75+    "../ccsrc/",
76+  ]
77+
78+  defines = [
79+    "SUPPORT_NNRT",
80+    "PRIMITIVE_WRITEABLE",
81+    "VERSION_STR=\"1.8.1\"",
82+  ]
83+
84+  configs = [
85+    ":mindspore_api",
86+    ":disable_android",
87+    ":secure_option",
88+  ]
89+
90+  external_deps = [ "neural_network_runtime:nnrt_target" ]
91+
92+  remove_configs = [ "//build/config/compiler:no_rtti" ]
93+
94+  output_name = "libmindspore_lite_ndk"
95+  output_extension = "so"
96+  innerapi_tags = [ "ndk"]
97+  cflags_cc = [
98+    "-Wno-ignored-qualifiers",
99+    "-Wunused-private-field",
100+    "-Wno-unused-private-field",
101+    "-Wno-inconsistent-missing-override",
102+    "-Wno-macro-redefined",
103+    "-Wno-constant-conversion",
104+  ]
105+  part_name = "mindspore"
106+  subsystem_name = "thirdparty"
107+}
108+
109 # Train library
110 expression_cxx_api_sources = [
111   "src/runtime/cxx_api/expression/net.cc",
112--
1132.34.1
114
115