Android.bp 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. /*
  2. * Copyright 2017 The Android Open Source Project
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. cc_library_headers {
  17. name: "libneuralnetworks_common_headers",
  18. host_supported: false,
  19. export_include_dirs: ["include"],
  20. }
  21. cc_defaults {
  22. name: "neuralnetworks_operations",
  23. srcs: [
  24. "OperationResolver.cpp",
  25. "operations/Activation.cpp",
  26. "operations/BidirectionalSequenceRNN.cpp",
  27. "operations/Broadcast.cpp",
  28. "operations/ChannelShuffle.cpp",
  29. "operations/Comparisons.cpp",
  30. "operations/Concatenation.cpp",
  31. "operations/Conv2D.cpp",
  32. "operations/Dequantize.cpp",
  33. "operations/Elementwise.cpp",
  34. "operations/FullyConnected.cpp",
  35. "operations/Gather.cpp",
  36. "operations/GenerateProposals.cpp",
  37. "operations/HeatmapMaxKeypoint.cpp",
  38. "operations/InstanceNormalization.cpp",
  39. "operations/L2Normalization.cpp",
  40. "operations/LogicalAndOr.cpp",
  41. "operations/LogicalNot.cpp",
  42. "operations/LogSoftmax.cpp",
  43. "operations/Neg.cpp",
  44. "operations/Pooling.cpp",
  45. "operations/PRelu.cpp",
  46. "operations/Quantize.cpp",
  47. "operations/Reduce.cpp",
  48. "operations/ResizeImageOps.cpp",
  49. "operations/RoiAlign.cpp",
  50. "operations/RoiPooling.cpp",
  51. "operations/Select.cpp",
  52. "operations/Slice.cpp",
  53. "operations/Softmax.cpp",
  54. "operations/Transpose.cpp",
  55. "operations/TransposeConv2D.cpp",
  56. "operations/UnidirectionalSequenceLSTM.cpp",
  57. "operations/UnidirectionalSequenceRNN.cpp",
  58. ],
  59. }
  60. cc_library_static {
  61. name: "libneuralnetworks_utils",
  62. defaults: ["neuralnetworks_defaults", "neuralnetworks_operations"],
  63. host_supported: false,
  64. vendor_available: true,
  65. export_include_dirs: ["include"],
  66. srcs: [
  67. "Utils.cpp",
  68. "ExecutionBurstController.cpp",
  69. "ExecutionBurstServer.cpp",
  70. ],
  71. header_libs: [
  72. "libneuralnetworks_headers",
  73. "libeigen",
  74. "gemmlowp_headers",
  75. "tensorflow_headers",
  76. ],
  77. shared_libs: [
  78. "libhidltransport",
  79. "libhidlmemory",
  80. "libnativewindow",
  81. "libfmq",
  82. "[email protected]",
  83. "[email protected]",
  84. "[email protected]",
  85. "[email protected]",
  86. "[email protected]",
  87. ],
  88. whole_static_libs: [
  89. "libarect",
  90. ],
  91. cflags: [
  92. "-DTF_LITE_DISABLE_X86_NEON",
  93. "-Werror",
  94. "-Wall",
  95. "-Wextra",
  96. "-Wno-extern-c-compat",
  97. "-Wno-sign-compare",
  98. "-Wno-unused-local-typedef",
  99. "-Wno-unused-parameter",
  100. "-Wno-unused-private-field",
  101. "-Wno-unused-variable",
  102. "-Wno-invalid-partial-specialization",
  103. ],
  104. }
  105. cc_library_static {
  106. name: "libneuralnetworks_common",
  107. defaults: ["neuralnetworks_defaults", "neuralnetworks_operations"],
  108. host_supported: false,
  109. vendor_available: true,
  110. // b/109953668, disable OpenMP
  111. // openmp: true,
  112. export_include_dirs: [
  113. "include",
  114. ],
  115. srcs: [
  116. "CpuExecutor.cpp",
  117. "ExecutionBurstController.cpp",
  118. "ExecutionBurstServer.cpp",
  119. "GraphDump.cpp",
  120. "IndexedShapeWrapper.cpp",
  121. "OperationsUtils.cpp",
  122. "TokenHasher.cpp",
  123. "Utils.cpp",
  124. "ValidateHal.cpp",
  125. "operations/ArgMinMax.cpp",
  126. "operations/BidirectionalSequenceLSTM.cpp",
  127. "operations/Cast.cpp",
  128. "operations/DepthwiseConv2D.cpp",
  129. "operations/EmbeddingLookup.cpp",
  130. "operations/ExpandDims.cpp",
  131. "operations/GroupedConv2D.cpp",
  132. "operations/HashtableLookup.cpp",
  133. "operations/LSHProjection.cpp",
  134. "operations/LSTM.cpp",
  135. "operations/MaximumMinimum.cpp",
  136. "operations/Multinomial.cpp",
  137. "operations/Normalization.cpp",
  138. "operations/Pow.cpp",
  139. "operations/TopK_V2.cpp",
  140. "operations/QuantizedLSTM.cpp",
  141. "operations/Reshape.cpp",
  142. "operations/RNN.cpp",
  143. "operations/SimpleMath.cpp",
  144. "operations/Split.cpp",
  145. "operations/StridedSlice.cpp",
  146. "operations/SVDF.cpp",
  147. "operations/Tile.cpp",
  148. ],
  149. shared_libs: [
  150. "libbase",
  151. "libcutils",
  152. "libhidlbase",
  153. "libhidltransport",
  154. "libhidlmemory",
  155. "libnativewindow",
  156. "libfmq",
  157. "libtextclassifier_hash",
  158. "libui",
  159. "liblog",
  160. "libutils",
  161. "[email protected]",
  162. "[email protected]",
  163. "[email protected]",
  164. "[email protected]",
  165. "[email protected]",
  166. ],
  167. static_libs: [
  168. "libcrypto_static",
  169. ],
  170. header_libs: [
  171. "libneuralnetworks_headers",
  172. "libtextclassifier_hash_headers",
  173. "libeigen",
  174. "gemmlowp_headers",
  175. "philox_random_headers",
  176. "tensorflow_headers",
  177. ],
  178. whole_static_libs: [
  179. "libarect",
  180. "libtflite_kernel_utils",
  181. "philox_random",
  182. ],
  183. cflags: [
  184. "-DNN_INCLUDE_CPU_IMPLEMENTATION",
  185. "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash",
  186. "-DTF_LITE_DISABLE_X86_NEON",
  187. "-Werror",
  188. "-Wall",
  189. "-Wextra",
  190. "-Wno-extern-c-compat",
  191. "-Wno-sign-compare",
  192. "-Wno-unused-local-typedef",
  193. "-Wno-unused-parameter",
  194. "-Wno-unused-private-field",
  195. "-Wno-unused-variable",
  196. "-Wno-invalid-partial-specialization",
  197. "-Wno-array-bounds",
  198. ],
  199. }
  200. cc_test {
  201. name: "NeuralNetworksTest_operations",
  202. shared_libs: [
  203. "libhidlmemory",
  204. "libnativewindow",
  205. "libneuralnetworks",
  206. "[email protected]",
  207. "[email protected]",
  208. "[email protected]",
  209. "[email protected]",
  210. "[email protected]",
  211. ],
  212. static_libs: [
  213. "libbase",
  214. "libgmock",
  215. "liblog",
  216. "libneuralnetworks_common",
  217. ],
  218. cflags: [
  219. "-Wno-extern-c-compat",
  220. "-Wno-unused-parameter",
  221. "-Wno-invalid-partial-specialization",
  222. ],
  223. srcs: [
  224. "operations/*Test.cpp",
  225. ],
  226. local_include_dirs: [ "include" ],
  227. header_libs: [
  228. "libeigen",
  229. "philox_random_headers",
  230. "tensorflow_headers",
  231. ],
  232. }
  233. cc_test {
  234. name: "NeuralNetworksTest_utils",
  235. shared_libs: [
  236. "libhidlmemory",
  237. "libnativewindow",
  238. "libneuralnetworks",
  239. "[email protected]",
  240. "[email protected]",
  241. "[email protected]",
  242. "[email protected]",
  243. "[email protected]",
  244. ],
  245. static_libs: [
  246. "libbase",
  247. "libgmock",
  248. "liblog",
  249. "libneuralnetworks_common",
  250. ],
  251. cflags: [
  252. "-Wno-extern-c-compat",
  253. "-Wno-unused-variable",
  254. ],
  255. srcs: [
  256. "UtilsTest.cpp",
  257. ],
  258. local_include_dirs: [ "include" ],
  259. header_libs: [
  260. "tensorflow_headers",
  261. ],
  262. }