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 17cc_library_headers { 18 name: "libneuralnetworks_common_headers", 19 host_supported: false, 20 export_include_dirs: ["include"], 21} 22 23cc_library_static { 24 name: "libneuralnetworks_utils", 25 defaults: ["neuralnetworks_defaults"], 26 host_supported: false, 27 vendor_available: true, 28 export_include_dirs: ["include"], 29 srcs: [ 30 "Utils.cpp", 31 ], 32 header_libs: [ 33 "libneuralnetworks_headers", 34 ], 35 shared_libs: [ 36 "libhidltransport", 37 "libhidlmemory", 38 "android.hardware.neuralnetworks@1.0", 39 "android.hardware.neuralnetworks@1.1", 40 "android.hidl.allocator@1.0", 41 "android.hidl.memory@1.0", 42 ], 43} 44 45cc_library_static { 46 name: "libneuralnetworks_common", 47 defaults: ["neuralnetworks_defaults"], 48 host_supported: false, 49 vendor_available: true, 50 openmp: true, 51 export_include_dirs: ["include"], 52 53 srcs: [ 54 "CpuExecutor.cpp", 55 "GraphDump.cpp", 56 "OperationsUtils.cpp", 57 "Utils.cpp", 58 "ValidateHal.cpp", 59 "operations/Activation.cpp", 60 "operations/Concatenation.cpp", 61 "operations/Conv2D.cpp", 62 "operations/DepthwiseConv2D.cpp", 63 "operations/EmbeddingLookup.cpp", 64 "operations/FullyConnected.cpp", 65 "operations/HashtableLookup.cpp", 66 "operations/LSHProjection.cpp", 67 "operations/LSTM.cpp", 68 "operations/Normalization.cpp", 69 "operations/Pooling.cpp", 70 "operations/Reshape.cpp", 71 "operations/RNN.cpp", 72 "operations/SimpleMath.cpp", 73 "operations/StridedSlice.cpp", 74 "operations/SVDF.cpp", 75 ], 76 shared_libs: [ 77 "libbase", 78 "libhidlbase", 79 "libhidltransport", 80 "libhidlmemory", 81 "libtextclassifier_hash", 82 "liblog", 83 "libutils", 84 "android.hardware.neuralnetworks@1.0", 85 "android.hardware.neuralnetworks@1.1", 86 "android.hidl.allocator@1.0", 87 "android.hidl.memory@1.0", 88 ], 89 header_libs: [ 90 "libneuralnetworks_headers", 91 "libtextclassifier_hash_headers", 92 "libeigen", 93 "gemmlowp_headers", 94 "tensorflow_headers", 95 ], 96 whole_static_libs: [ 97 "libtflite_kernel_utils", 98 ], 99 100 cflags: [ 101 "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash", 102 "-Werror", 103 "-Wall", 104 "-Wextra", 105 "-Wno-extern-c-compat", 106 "-Wno-unused-parameter", 107 "-Wno-unused-variable", 108 "-Wno-invalid-partial-specialization", 109 ], 110 111} 112 113cc_defaults { 114 name: "neuralnetworks_op_test_defaults", 115 shared_libs: [ 116 "libneuralnetworks", 117 ], 118 static_libs: [ 119 "libgmock", 120 ], 121 cflags: [ 122 "-Wno-extern-c-compat", 123 ] 124} 125 126cc_test { 127 name: "embedding_lookup_test", 128 defaults: ["neuralnetworks_op_test_defaults"], 129 srcs: [ 130 "operations/EmbeddingLookupTest.cpp", 131 ], 132} 133 134cc_test { 135 name: "hashtable_lookup_test", 136 defaults: ["neuralnetworks_op_test_defaults"], 137 srcs: [ 138 "operations/HashtableLookupTest.cpp", 139 ], 140} 141 142cc_test { 143 name: "lsh_projection_test", 144 defaults: ["neuralnetworks_op_test_defaults"], 145 srcs: [ 146 "operations/LSHProjectionTest.cpp", 147 ], 148 local_include_dirs: [ "include" ], 149 header_libs: [ 150 "tensorflow_headers", 151 ], 152} 153 154cc_test { 155 name: "lstm_test", 156 defaults: ["neuralnetworks_op_test_defaults"], 157 srcs: [ 158 "operations/LSTMTest.cpp", 159 ], 160 local_include_dirs: [ "include" ], 161 header_libs: [ 162 "tensorflow_headers", 163 ], 164} 165 166cc_test { 167 name: "rnn_test", 168 defaults: ["neuralnetworks_op_test_defaults"], 169 srcs: [ 170 "operations/RNNTest.cpp", 171 ], 172 local_include_dirs: [ "include" ], 173} 174 175cc_test { 176 name: "svdf_test", 177 defaults: ["neuralnetworks_op_test_defaults"], 178 srcs: [ 179 "operations/SVDFTest.cpp", 180 ], 181 local_include_dirs: [ "include" ], 182 header_libs: [ 183 "tensorflow_headers", 184 ], 185} 186