Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 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 | |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 17 | package { |
Bob Badour | 58f681f | 2022-01-24 17:45:12 -0800 | [diff] [blame] | 18 | // Inherits all licenses from parent to get Apache 2.0 and package name |
| 19 | default_applicable_licenses: [ |
| 20 | "packages_modules_NeuralNetworks_license", |
| 21 | ], |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 22 | } |
| 23 | |
Jean-Luc Brouillet | 873c008 | 2017-07-25 00:17:50 -0700 | [diff] [blame] | 24 | cc_library_headers { |
| 25 | name: "libneuralnetworks_common_headers", |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 26 | host_supported: true, |
Jean-Luc Brouillet | 873c008 | 2017-07-25 00:17:50 -0700 | [diff] [blame] | 27 | export_include_dirs: ["include"], |
| 28 | } |
| 29 | |
Chih-Hung Hsieh | cebf3e9 | 2021-09-17 11:45:15 -0700 | [diff] [blame] | 30 | // The following files took too much time to compile with clang-tidy. |
| 31 | tidy_disabled_common_operations_files = [ |
Michael Butler | 762af8c | 2022-03-08 21:01:17 -0800 | [diff] [blame] | 32 | "cpu_operations/Activation.cpp", |
| 33 | "cpu_operations/Broadcast.cpp", |
| 34 | "cpu_operations/Concatenation.cpp", |
| 35 | "cpu_operations/Conv2D.cpp", |
| 36 | "cpu_operations/FullyConnected.cpp", |
| 37 | "cpu_operations/L2Normalization.cpp", |
| 38 | "cpu_operations/LocalResponseNormalization.cpp", |
| 39 | "cpu_operations/PRelu.cpp", |
| 40 | "cpu_operations/Pooling.cpp", |
| 41 | "cpu_operations/Reshape.cpp", |
| 42 | "cpu_operations/SimpleMath.cpp", |
| 43 | "cpu_operations/Softmax.cpp", |
| 44 | "cpu_operations/Transpose.cpp", |
Chih-Hung Hsieh | cebf3e9 | 2021-09-17 11:45:15 -0700 | [diff] [blame] | 45 | ] |
| 46 | |
Slava Shklyaev | a694425 | 2018-11-06 15:32:44 +0000 | [diff] [blame] | 47 | cc_defaults { |
| 48 | name: "neuralnetworks_operations", |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 49 | host_supported: true, |
Michael Butler | 762af8c | 2022-03-08 21:01:17 -0800 | [diff] [blame] | 50 | local_include_dirs: ["types/operations/include"], |
Slava Shklyaev | a694425 | 2018-11-06 15:32:44 +0000 | [diff] [blame] | 51 | srcs: [ |
| 52 | "OperationResolver.cpp", |
Michael Butler | 762af8c | 2022-03-08 21:01:17 -0800 | [diff] [blame] | 53 | "cpu_operations/Activation.cpp", |
| 54 | "cpu_operations/BatchMatmul.cpp", |
| 55 | "cpu_operations/BidirectionalSequenceRNN.cpp", |
| 56 | "cpu_operations/Broadcast.cpp", |
| 57 | "cpu_operations/ChannelShuffle.cpp", |
| 58 | "cpu_operations/Comparisons.cpp", |
| 59 | "cpu_operations/Concatenation.cpp", |
| 60 | "cpu_operations/Conv2D.cpp", |
| 61 | "cpu_operations/Densify.cpp", |
| 62 | "cpu_operations/DepthwiseConv2D.cpp", |
| 63 | "cpu_operations/Dequantize.cpp", |
| 64 | "cpu_operations/Elementwise.cpp", |
| 65 | "cpu_operations/Elu.cpp", |
| 66 | "cpu_operations/Fill.cpp", |
| 67 | "cpu_operations/FullyConnected.cpp", |
| 68 | "cpu_operations/Gather.cpp", |
| 69 | "cpu_operations/GenerateProposals.cpp", |
| 70 | "cpu_operations/HeatmapMaxKeypoint.cpp", |
| 71 | "cpu_operations/InstanceNormalization.cpp", |
| 72 | "cpu_operations/L2Normalization.cpp", |
| 73 | "cpu_operations/LocalResponseNormalization.cpp", |
| 74 | "cpu_operations/LogSoftmax.cpp", |
| 75 | "cpu_operations/LogicalAndOr.cpp", |
| 76 | "cpu_operations/LogicalNot.cpp", |
| 77 | "cpu_operations/MirrorPad.cpp", |
| 78 | "cpu_operations/Neg.cpp", |
| 79 | "cpu_operations/PRelu.cpp", |
| 80 | "cpu_operations/Pack.cpp", |
| 81 | "cpu_operations/Pooling.cpp", |
| 82 | "cpu_operations/QLSTM.cpp", |
| 83 | "cpu_operations/Quantize.cpp", |
| 84 | "cpu_operations/Rank.cpp", |
| 85 | "cpu_operations/Reduce.cpp", |
| 86 | "cpu_operations/ResizeImageOps.cpp", |
| 87 | "cpu_operations/Reverse.cpp", |
| 88 | "cpu_operations/RoiAlign.cpp", |
| 89 | "cpu_operations/RoiPooling.cpp", |
| 90 | "cpu_operations/Select.cpp", |
| 91 | "cpu_operations/Slice.cpp", |
| 92 | "cpu_operations/Softmax.cpp", |
| 93 | "cpu_operations/Squeeze.cpp", |
| 94 | "cpu_operations/StridedSlice.cpp", |
| 95 | "cpu_operations/TopK_V2.cpp", |
| 96 | "cpu_operations/Transpose.cpp", |
| 97 | "cpu_operations/TransposeConv2D.cpp", |
| 98 | "cpu_operations/UnidirectionalSequenceLSTM.cpp", |
| 99 | "cpu_operations/UnidirectionalSequenceRNN.cpp", |
Slava Shklyaev | a694425 | 2018-11-06 15:32:44 +0000 | [diff] [blame] | 100 | ], |
Chih-Hung Hsieh | cebf3e9 | 2021-09-17 11:45:15 -0700 | [diff] [blame] | 101 | tidy_disabled_srcs: tidy_disabled_common_operations_files, |
Slava Shklyaev | a694425 | 2018-11-06 15:32:44 +0000 | [diff] [blame] | 102 | } |
| 103 | |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 104 | // libneuralnetworks_common* provides common utilities for the NNAPI runtime, drivers, and tests to |
Michael Butler | 1e3b3f8 | 2021-11-15 13:21:17 -0800 | [diff] [blame] | 105 | // use. Two variants of the common library are provided: |
Michael Butler | a671aa9 | 2021-11-03 21:55:59 -0700 | [diff] [blame] | 106 | // - libneuralnetworks_common: the common library, used by NNAPI runtime and tests. |
| 107 | // - libneuralnetworks_common_experimental: the common library with NN_EXPERIMENTAL_FEATURE flag |
| 108 | // turned on, used by NNAPI drivers and tests for experimental features. |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 109 | // |
Michael Butler | 1e3b3f8 | 2021-11-15 13:21:17 -0800 | [diff] [blame] | 110 | // Both variants of the common library also link against all versions (1.0-3) of the NNAPI HIDL |
Michael Butler | a671aa9 | 2021-11-03 21:55:59 -0700 | [diff] [blame] | 111 | // library. |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 112 | // |
rayhdez | 06a6097 | 2021-08-13 22:46:33 +0000 | [diff] [blame] | 113 | cc_defaults { |
Michael Butler | 6852e83 | 2021-11-01 17:50:09 -0700 | [diff] [blame] | 114 | name: "libneuralnetworks_common_defaults", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 115 | defaults: [ |
| 116 | "neuralnetworks_defaults", |
| 117 | "neuralnetworks_operations", |
| 118 | ], |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 119 | host_supported: true, |
Przemyslaw Szczepaniak | 739ca9e | 2020-02-05 14:36:44 +0000 | [diff] [blame] | 120 | apex_available: [ |
Slava Shklyaev | fec9281 | 2020-02-13 13:07:44 +0000 | [diff] [blame] | 121 | "//apex_available:platform", |
Przemyslaw Szczepaniak | 739ca9e | 2020-02-05 14:36:44 +0000 | [diff] [blame] | 122 | "com.android.neuralnetworks", |
| 123 | "test_com.android.neuralnetworks", |
| 124 | ], |
Yifan Hong | d1b6f90 | 2017-07-27 16:15:02 -0700 | [diff] [blame] | 125 | vendor_available: true, |
Miao Wang | ccab3f4 | 2018-06-18 23:32:17 -0700 | [diff] [blame] | 126 | // b/109953668, disable OpenMP |
| 127 | // openmp: true, |
Michael K. Sanders | ecba4dd | 2018-12-07 14:30:34 +0000 | [diff] [blame] | 128 | export_include_dirs: [ |
| 129 | "include", |
| 130 | ], |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 131 | srcs: [ |
Michael Butler | 9c003ce | 2021-12-15 16:03:18 -0800 | [diff] [blame] | 132 | "ActivationFunctor.cpp", |
Xusong Wang | aeb9cf5 | 2020-02-03 16:24:35 -0800 | [diff] [blame] | 133 | "BufferTracker.cpp", |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 134 | "CpuExecutor.cpp", |
Michael Butler | 8a6edbd | 2019-01-17 17:54:51 -0800 | [diff] [blame] | 135 | "ExecutionBurstController.cpp", |
| 136 | "ExecutionBurstServer.cpp", |
David Gross | 7ba3463 | 2017-12-04 11:29:28 -0800 | [diff] [blame] | 137 | "GraphDump.cpp", |
Michael Butler | 5cbc18a | 2021-01-06 20:00:06 -0800 | [diff] [blame] | 138 | "HalBufferTracker.cpp", |
Slava Shklyaev | 52d535c | 2018-10-30 12:17:23 +0000 | [diff] [blame] | 139 | "IndexedShapeWrapper.cpp", |
Slava Shklyaev | 5d85d5a | 2020-11-16 12:24:07 +0000 | [diff] [blame] | 140 | "LegacyHalUtils.cpp", |
Slava Shklyaev | d5dd434 | 2020-11-13 14:12:24 +0000 | [diff] [blame] | 141 | "LegacyUtils.cpp", |
Slava Shklyaev | 79534bc | 2019-05-22 11:10:13 +0100 | [diff] [blame] | 142 | "MemoryUtils.cpp", |
David Gross | 25ffe52 | 2019-07-26 14:39:14 -0700 | [diff] [blame] | 143 | "MetaModel.cpp", |
Michael Butler | 9e8def6 | 2022-01-12 18:18:27 -0800 | [diff] [blame] | 144 | "ModelUtils.cpp", |
Michael Butler | ad44496 | 2022-01-31 13:30:14 -0800 | [diff] [blame] | 145 | "OperationsExecutionUtils.cpp", |
Viet Dang | d0137f7 | 2019-12-04 16:18:08 +0000 | [diff] [blame] | 146 | "QuantUtils.cpp", |
Xusong Wang | 81f3feb | 2019-01-14 18:53:00 -0800 | [diff] [blame] | 147 | "TokenHasher.cpp", |
Jean-Luc Brouillet | c6af094 | 2017-10-11 22:28:55 -0700 | [diff] [blame] | 148 | "ValidateHal.cpp", |
Michael Butler | 762af8c | 2022-03-08 21:01:17 -0800 | [diff] [blame] | 149 | "cpu_operations/ArgMinMax.cpp", |
| 150 | "cpu_operations/BidirectionalSequenceLSTM.cpp", |
| 151 | "cpu_operations/Cast.cpp", |
| 152 | "cpu_operations/EmbeddingLookup.cpp", |
| 153 | "cpu_operations/ExpandDims.cpp", |
| 154 | "cpu_operations/GroupedConv2D.cpp", |
| 155 | "cpu_operations/HashtableLookup.cpp", |
| 156 | "cpu_operations/LSHProjection.cpp", |
| 157 | "cpu_operations/LSTM.cpp", |
| 158 | "cpu_operations/MaximumMinimum.cpp", |
| 159 | "cpu_operations/Multinomial.cpp", |
| 160 | "cpu_operations/Pow.cpp", |
| 161 | "cpu_operations/QuantizedLSTM.cpp", |
| 162 | "cpu_operations/RNN.cpp", |
| 163 | "cpu_operations/Reshape.cpp", |
| 164 | "cpu_operations/SVDF.cpp", |
| 165 | "cpu_operations/SimpleMath.cpp", |
| 166 | "cpu_operations/Split.cpp", |
| 167 | "cpu_operations/Tile.cpp", |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 168 | ], |
Jean-Luc Brouillet | 873c008 | 2017-07-25 00:17:50 -0700 | [diff] [blame] | 169 | shared_libs: [ |
Jean-Luc Brouillet | 873c008 | 2017-07-25 00:17:50 -0700 | [diff] [blame] | 170 | "android.hardware.neuralnetworks@1.0", |
Michael Butler | 307d401 | 2018-01-23 11:05:43 -0800 | [diff] [blame] | 171 | "android.hardware.neuralnetworks@1.1", |
Slava Shklyaev | 2be33b0 | 2018-09-14 13:34:31 +0100 | [diff] [blame] | 172 | "android.hardware.neuralnetworks@1.2", |
Lev Proleev | 26f6705 | 2019-09-11 11:21:46 +0100 | [diff] [blame] | 173 | "android.hardware.neuralnetworks@1.3", |
Jean-Luc Brouillet | 873c008 | 2017-07-25 00:17:50 -0700 | [diff] [blame] | 174 | "android.hidl.allocator@1.0", |
| 175 | "android.hidl.memory@1.0", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 176 | "libbase", |
| 177 | "libcutils", |
| 178 | "libfmq", |
| 179 | "libhidlbase", |
| 180 | "libhidlmemory", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 181 | "liblog", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 182 | "libutils", |
Jean-Luc Brouillet | 873c008 | 2017-07-25 00:17:50 -0700 | [diff] [blame] | 183 | ], |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 184 | target: { |
| 185 | android: { |
| 186 | shared_libs: ["libnativewindow"], |
| 187 | }, |
| 188 | host: { |
| 189 | cflags: [ |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 190 | "-D__INTRODUCED_IN(x)=", |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 191 | ], |
| 192 | }, |
| 193 | }, |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 194 | header_libs: [ |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 195 | "gemmlowp_headers", |
| 196 | "libeigen", |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 197 | "libneuralnetworks_headers", |
Yang Ni | 4365661 | 2017-08-22 16:18:50 -0700 | [diff] [blame] | 198 | "libtextclassifier_hash_headers", |
Michael K. Sanders | a9f0fa6 | 2018-09-25 11:53:55 +0100 | [diff] [blame] | 199 | "philox_random_headers", |
Miao Wang | 658dc37 | 2017-12-14 15:01:31 -0800 | [diff] [blame] | 200 | "tensorflow_headers", |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 201 | ], |
Miao Wang | 658dc37 | 2017-12-14 15:01:31 -0800 | [diff] [blame] | 202 | whole_static_libs: [ |
Miao Wang | 484e970 | 2019-01-16 13:42:15 -0800 | [diff] [blame] | 203 | "libarect", |
Miao Wang | 658dc37 | 2017-12-14 15:01:31 -0800 | [diff] [blame] | 204 | "libtflite_kernel_utils", |
Slava Shklyaev | 9f29f43 | 2020-08-13 13:16:03 +0100 | [diff] [blame] | 205 | "neuralnetworks_types", |
| 206 | "neuralnetworks_utils_hal_1_0", // TODO(b/160669116): Remove VNDK dependencies. |
| 207 | "neuralnetworks_utils_hal_1_1", |
| 208 | "neuralnetworks_utils_hal_1_2", |
| 209 | "neuralnetworks_utils_hal_1_3", |
| 210 | "neuralnetworks_utils_hal_common", |
Michael K. Sanders | a9f0fa6 | 2018-09-25 11:53:55 +0100 | [diff] [blame] | 211 | "philox_random", |
Miao Wang | 658dc37 | 2017-12-14 15:01:31 -0800 | [diff] [blame] | 212 | ], |
Przemyslaw Szczepaniak | 303ab57 | 2020-01-31 16:50:59 +0000 | [diff] [blame] | 213 | static_libs: [ |
| 214 | "libcrypto_static", |
Lev Proleev | 82112fb | 2021-02-25 13:36:02 +0000 | [diff] [blame] | 215 | "libruy_static", |
Przemyslaw Szczepaniak | 303ab57 | 2020-01-31 16:50:59 +0000 | [diff] [blame] | 216 | "libtextclassifier_hash_static", |
Michael Butler | ad44496 | 2022-01-31 13:30:14 -0800 | [diff] [blame] | 217 | "neuralnetworks_types", |
Przemyslaw Szczepaniak | 303ab57 | 2020-01-31 16:50:59 +0000 | [diff] [blame] | 218 | ], |
Miao Wang | 9d04c2d | 2017-07-25 17:06:18 -0700 | [diff] [blame] | 219 | cflags: [ |
Yang Ni | 4365661 | 2017-08-22 16:18:50 -0700 | [diff] [blame] | 220 | "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 221 | "-DNN_INCLUDE_CPU_IMPLEMENTATION", |
Miao Wang | 4eaedb2 | 2019-01-17 20:11:20 -0800 | [diff] [blame] | 222 | "-DTF_LITE_DISABLE_X86_NEON", |
Miao Wang | 9d04c2d | 2017-07-25 17:06:18 -0700 | [diff] [blame] | 223 | ], |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 224 | } |
Yang Ni | 52d179b | 2017-08-21 11:16:39 -0700 | [diff] [blame] | 225 | |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 226 | cc_library_static { |
rayhdez | 06a6097 | 2021-08-13 22:46:33 +0000 | [diff] [blame] | 227 | name: "libneuralnetworks_common", |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 228 | defaults: [ |
Michael Butler | 6852e83 | 2021-11-01 17:50:09 -0700 | [diff] [blame] | 229 | "libneuralnetworks_common_defaults", |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 230 | ], |
rayhdez | 06a6097 | 2021-08-13 22:46:33 +0000 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | cc_library_static { |
| 234 | name: "libneuralnetworks_common_experimental", |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 235 | defaults: [ |
Michael Butler | 6852e83 | 2021-11-01 17:50:09 -0700 | [diff] [blame] | 236 | "libneuralnetworks_common_defaults", |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 237 | ], |
Michael Butler | 0da8387 | 2021-11-05 14:20:12 -0700 | [diff] [blame] | 238 | exclude_static_libs: [ |
| 239 | "neuralnetworks_types", |
| 240 | ], |
| 241 | static_libs: [ |
| 242 | "neuralnetworks_types_experimental", |
| 243 | ], |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 244 | cflags: [ |
| 245 | "-DNN_EXPERIMENTAL_FEATURE", |
| 246 | ], |
rayhdez | 06a6097 | 2021-08-13 22:46:33 +0000 | [diff] [blame] | 247 | } |
| 248 | |
Stefano Galarraga | 8ec28fb | 2019-06-27 09:52:09 +0100 | [diff] [blame] | 249 | cc_defaults { |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 250 | name: "neuralnetworks_cl_defaults", |
| 251 | host_supported: false, |
| 252 | vendor_available: false, |
| 253 | stl: "libc++_static", |
| 254 | sdk_version: "current", |
Slava Shklyaev | 458b564 | 2021-02-25 10:47:08 +0000 | [diff] [blame] | 255 | min_sdk_version: "29", |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 256 | cflags: [ |
| 257 | "-DNN_COMPATIBILITY_LIBRARY_BUILD", |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 258 | ], |
| 259 | } |
| 260 | |
Slava Shklyaev | 84829a9 | 2021-02-26 12:05:38 +0000 | [diff] [blame] | 261 | cc_defaults { |
| 262 | name: "libneuralnetworks_common_cl_defaults", |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 263 | defaults: [ |
| 264 | "neuralnetworks_cl_defaults", |
| 265 | "neuralnetworks_defaults", |
| 266 | "neuralnetworks_operations", |
| 267 | ], |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 268 | host_supported: false, |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 269 | apex_available: [ |
| 270 | "//apex_available:platform", |
| 271 | "com.android.neuralnetworks", |
| 272 | "test_com.android.neuralnetworks", |
| 273 | ], |
| 274 | // b/109953668, disable OpenMP |
| 275 | // openmp: true, |
| 276 | export_include_dirs: [ |
| 277 | "include", |
| 278 | ], |
| 279 | srcs: [ |
| 280 | "BufferTracker.cpp", |
| 281 | "CpuExecutor.cpp", |
| 282 | "GraphDump.cpp", |
| 283 | "IndexedShapeWrapper.cpp", |
| 284 | "LegacyUtils.cpp", |
| 285 | "MetaModel.cpp", |
Michael Butler | 9e8def6 | 2022-01-12 18:18:27 -0800 | [diff] [blame] | 286 | "ModelUtils.cpp", |
Michael Butler | ad44496 | 2022-01-31 13:30:14 -0800 | [diff] [blame] | 287 | "OperationsExecutionUtils.cpp", |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 288 | "TokenHasher.cpp", |
| 289 | ], |
| 290 | header_libs: [ |
| 291 | "libneuralnetworks_headers_ndk", |
| 292 | ], |
| 293 | static_libs: [ |
| 294 | "libbase_ndk", |
| 295 | "libcrypto_static", |
Michael Butler | ad44496 | 2022-01-31 13:30:14 -0800 | [diff] [blame] | 296 | "neuralnetworks_types_cl", |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 297 | ], |
| 298 | shared_libs: [ |
| 299 | "libnativewindow", |
| 300 | ], |
| 301 | cflags: [ |
| 302 | "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash", |
| 303 | "-DTF_LITE_DISABLE_X86_NEON", |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 304 | ], |
| 305 | } |
| 306 | |
Slava Shklyaev | 84829a9 | 2021-02-26 12:05:38 +0000 | [diff] [blame] | 307 | cc_library_static { |
| 308 | name: "libneuralnetworks_common_cl", |
| 309 | defaults: ["libneuralnetworks_common_cl_defaults"], |
| 310 | } |
| 311 | |
| 312 | cc_library_static { |
| 313 | name: "libneuralnetworks_common_cl_cpu", |
| 314 | defaults: ["libneuralnetworks_common_cl_defaults"], |
Michael Butler | 762af8c | 2022-03-08 21:01:17 -0800 | [diff] [blame] | 315 | local_include_dirs: ["types/operations/include"], |
Slava Shklyaev | 84829a9 | 2021-02-26 12:05:38 +0000 | [diff] [blame] | 316 | header_libs: [ |
| 317 | "gemmlowp_headers", |
| 318 | "libeigen", |
| 319 | "libruy_headers", |
| 320 | "libtextclassifier_hash_headers", |
| 321 | "philox_random_headers", |
| 322 | "tensorflow_headers", |
| 323 | ], |
| 324 | whole_static_libs: [ |
Michael Butler | c96ab33 | 2022-02-02 18:16:41 -0800 | [diff] [blame] | 325 | "philox_random_cl", |
Slava Shklyaev | 84829a9 | 2021-02-26 12:05:38 +0000 | [diff] [blame] | 326 | ], |
| 327 | static_libs: [ |
| 328 | "libcrypto_static", |
| 329 | "libtextclassifier_hash_static", |
| 330 | ], |
| 331 | srcs: [ |
Michael Butler | 9c003ce | 2021-12-15 16:03:18 -0800 | [diff] [blame] | 332 | "ActivationFunctor.cpp", |
Slava Shklyaev | 84829a9 | 2021-02-26 12:05:38 +0000 | [diff] [blame] | 333 | "QuantUtils.cpp", |
Michael Butler | 762af8c | 2022-03-08 21:01:17 -0800 | [diff] [blame] | 334 | "cpu_operations/ArgMinMax.cpp", |
| 335 | "cpu_operations/BidirectionalSequenceLSTM.cpp", |
| 336 | "cpu_operations/Cast.cpp", |
| 337 | "cpu_operations/EmbeddingLookup.cpp", |
| 338 | "cpu_operations/ExpandDims.cpp", |
| 339 | "cpu_operations/GroupedConv2D.cpp", |
| 340 | "cpu_operations/HashtableLookup.cpp", |
| 341 | "cpu_operations/LSHProjection.cpp", |
| 342 | "cpu_operations/LSTM.cpp", |
| 343 | "cpu_operations/MaximumMinimum.cpp", |
| 344 | "cpu_operations/Multinomial.cpp", |
| 345 | "cpu_operations/Pow.cpp", |
| 346 | "cpu_operations/QuantizedLSTM.cpp", |
| 347 | "cpu_operations/RNN.cpp", |
| 348 | "cpu_operations/Reshape.cpp", |
| 349 | "cpu_operations/SVDF.cpp", |
| 350 | "cpu_operations/SimpleMath.cpp", |
| 351 | "cpu_operations/Split.cpp", |
| 352 | "cpu_operations/Tile.cpp", |
Slava Shklyaev | 84829a9 | 2021-02-26 12:05:38 +0000 | [diff] [blame] | 353 | ], |
| 354 | cflags: [ |
| 355 | "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash", |
| 356 | "-DNN_COMPATIBILITY_LIBRARY_BUILD", |
| 357 | "-DNN_INCLUDE_CPU_IMPLEMENTATION", |
| 358 | "-DTF_LITE_DISABLE_X86_NEON", |
Slava Shklyaev | 84829a9 | 2021-02-26 12:05:38 +0000 | [diff] [blame] | 359 | ], |
| 360 | } |
| 361 | |
Slava Shklyaev | c958cd8 | 2020-12-10 16:55:55 +0000 | [diff] [blame] | 362 | cc_defaults { |
Stefano Galarraga | 8ec28fb | 2019-06-27 09:52:09 +0100 | [diff] [blame] | 363 | name: "NeuralNetworksTest_common", |
Michael Butler | 8e5fb87 | 2021-10-28 01:54:26 +0000 | [diff] [blame] | 364 | defaults: [ |
| 365 | "neuralnetworks_float16", |
| 366 | "neuralnetworks_use_latest_utils_hal_aidl", |
| 367 | ], |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 368 | host_supported: true, |
Yang Ni | 4e28bc1 | 2017-08-11 16:09:51 -0700 | [diff] [blame] | 369 | shared_libs: [ |
Michael K. Sanders | a9f0fa6 | 2018-09-25 11:53:55 +0100 | [diff] [blame] | 370 | "android.hidl.allocator@1.0", |
| 371 | "android.hidl.memory@1.0", |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 372 | "libcutils", |
Przemyslaw Szczepaniak | ec8a3bd | 2019-09-19 17:40:18 +0100 | [diff] [blame] | 373 | "libhidlbase", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 374 | "libhidlmemory", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 375 | "libneuralnetworks", |
Przemyslaw Szczepaniak | b1de3cc | 2019-09-04 10:36:58 +0100 | [diff] [blame] | 376 | "libneuralnetworks_packageinfo", |
Xusong Wang | 40c9f59 | 2020-07-31 16:12:31 -0700 | [diff] [blame] | 377 | "libutils", |
Yang Ni | 4e28bc1 | 2017-08-11 16:09:51 -0700 | [diff] [blame] | 378 | ], |
| 379 | static_libs: [ |
Przemyslaw Szczepaniak | ec8a3bd | 2019-09-19 17:40:18 +0100 | [diff] [blame] | 380 | "android.hardware.neuralnetworks@1.0", |
| 381 | "android.hardware.neuralnetworks@1.1", |
| 382 | "android.hardware.neuralnetworks@1.2", |
Lev Proleev | 26f6705 | 2019-09-11 11:21:46 +0100 | [diff] [blame] | 383 | "android.hardware.neuralnetworks@1.3", |
Lev Proleev | 7f4d4c7 | 2018-11-08 12:06:38 +0000 | [diff] [blame] | 384 | "libbase", |
Yang Ni | 4e28bc1 | 2017-08-11 16:09:51 -0700 | [diff] [blame] | 385 | "libgmock", |
Lev Proleev | 7f4d4c7 | 2018-11-08 12:06:38 +0000 | [diff] [blame] | 386 | "liblog", |
Michael K. Sanders | a9f0fa6 | 2018-09-25 11:53:55 +0100 | [diff] [blame] | 387 | "libneuralnetworks_common", |
Michael Butler | ad44496 | 2022-01-31 13:30:14 -0800 | [diff] [blame] | 388 | "neuralnetworks_types", |
Yang Ni | 4e28bc1 | 2017-08-11 16:09:51 -0700 | [diff] [blame] | 389 | ], |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 390 | target: { |
| 391 | android: { |
| 392 | shared_libs: [ |
| 393 | "libnativewindow", |
| 394 | ], |
| 395 | }, |
| 396 | host: { |
| 397 | cflags: [ |
| 398 | "-D__ANDROID_API_S__=31", |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 399 | "-D__INTRODUCED_IN(n)=", |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 400 | ], |
| 401 | }, |
| 402 | }, |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 403 | local_include_dirs: ["include"], |
Stefano Galarraga | 8ec28fb | 2019-06-27 09:52:09 +0100 | [diff] [blame] | 404 | } |
| 405 | |
| 406 | cc_test { |
| 407 | name: "NeuralNetworksTest_operations", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 408 | defaults: ["NeuralNetworksTest_common"], |
Michael Butler | 762af8c | 2022-03-08 21:01:17 -0800 | [diff] [blame] | 409 | local_include_dirs: ["types/operations/include"], |
Miao Wang | ba69adf | 2018-01-26 02:30:50 -0800 | [diff] [blame] | 410 | srcs: [ |
Michael Butler | 762af8c | 2022-03-08 21:01:17 -0800 | [diff] [blame] | 411 | "cpu_operations/*Test.cpp", |
Yang Ni | a7b8f5d | 2017-08-11 14:29:39 -0700 | [diff] [blame] | 412 | ], |
Yang Ni | 9780bd6 | 2017-10-05 15:05:49 -0700 | [diff] [blame] | 413 | header_libs: [ |
Lev Proleev | 8bd6eb7 | 2020-02-06 14:39:41 +0000 | [diff] [blame] | 414 | "gemmlowp_headers", |
Michael K. Sanders | a9f0fa6 | 2018-09-25 11:53:55 +0100 | [diff] [blame] | 415 | "libeigen", |
| 416 | "philox_random_headers", |
Yang Ni | 9780bd6 | 2017-10-05 15:05:49 -0700 | [diff] [blame] | 417 | "tensorflow_headers", |
| 418 | ], |
Yang Ni | a7b8f5d | 2017-08-11 14:29:39 -0700 | [diff] [blame] | 419 | } |
Lev Proleev | 8e3e09f | 2018-10-18 14:33:39 +0100 | [diff] [blame] | 420 | |
| 421 | cc_test { |
| 422 | name: "NeuralNetworksTest_utils", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 423 | defaults: ["NeuralNetworksTest_common"], |
Lev Proleev | 8e3e09f | 2018-10-18 14:33:39 +0100 | [diff] [blame] | 424 | srcs: [ |
| 425 | "UtilsTest.cpp", |
| 426 | ], |
Lev Proleev | 8e3e09f | 2018-10-18 14:33:39 +0100 | [diff] [blame] | 427 | header_libs: [ |
Lev Proleev | 8bd6eb7 | 2020-02-06 14:39:41 +0000 | [diff] [blame] | 428 | "gemmlowp_headers", |
| 429 | "libeigen", |
Lev Proleev | 8e3e09f | 2018-10-18 14:33:39 +0100 | [diff] [blame] | 430 | "tensorflow_headers", |
| 431 | ], |
Lev Proleev | bb24c9e | 2020-04-08 16:29:59 +0100 | [diff] [blame] | 432 | test_suites: [ |
| 433 | "general-tests", |
| 434 | ], |
Stefano Galarraga | 8ec28fb | 2019-06-27 09:52:09 +0100 | [diff] [blame] | 435 | } |
| 436 | |
| 437 | cc_test { |
| 438 | name: "NeuralNetworksTest_logtag", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 439 | defaults: ["NeuralNetworksTest_common"], |
Stefano Galarraga | 8ec28fb | 2019-06-27 09:52:09 +0100 | [diff] [blame] | 440 | srcs: [ |
| 441 | "LogTagTest.cpp", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 442 | "LogTagTestExtra.cpp", |
Stefano Galarraga | 8ec28fb | 2019-06-27 09:52:09 +0100 | [diff] [blame] | 443 | ], |
Lev Proleev | 8e3e09f | 2018-10-18 14:33:39 +0100 | [diff] [blame] | 444 | } |