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 17package { 18 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21cc_defaults { 22 name: "NeuralNetworksSampleDriver_defaults", 23 defaults: ["neuralnetworks_defaults"], 24 // b/109953668, disable OpenMP 25 // openmp: true, 26 srcs: [ 27 "SampleDriver.cpp", 28 "SampleDriverFull.cpp", 29 "SampleDriverPartial.cpp", 30 "SampleDriverUtils.cpp", 31 ], 32 header_libs: [ 33 "libneuralnetworks_headers", 34 ], 35 shared_libs: [ 36 "android.hardware.neuralnetworks-V1-ndk_platform", 37 "android.hardware.neuralnetworks@1.0", 38 "android.hardware.neuralnetworks@1.1", 39 "android.hardware.neuralnetworks@1.2", 40 "android.hardware.neuralnetworks@1.3", 41 "android.hidl.allocator@1.0", 42 "android.hidl.memory@1.0", 43 "libbase", 44 "libcutils", 45 "libdl", 46 "libfmq", 47 "libhardware", 48 "libhidlbase", 49 "libhidlmemory", 50 "liblog", 51 "libnativewindow", 52 "libtextclassifier_hash", 53 "libutils", 54 ], 55 static_libs: [ 56 "libneuralnetworks_common", 57 ], 58} 59 60cc_defaults { 61 name: "NeuralNetworksSampleDriver_server_defaults", 62 defaults: ["NeuralNetworksSampleDriver_defaults"], 63 relative_install_path: "hw", 64 proprietary: true, 65} 66 67cc_binary { 68 name: "android.hardware.neuralnetworks@1.3-service-sample-all", 69 srcs: ["SampleDriverAll.cpp"], 70 defaults: ["NeuralNetworksSampleDriver_server_defaults"], 71 init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-all.rc"], 72 vintf_fragments: ["config/android.hardware.neuralnetworks@1.3-service-sample-all.xml"], 73} 74 75cc_binary { 76 name: "android.hardware.neuralnetworks@1.3-service-sample-float-fast", 77 srcs: ["SampleDriverFloatFast.cpp"], 78 defaults: ["NeuralNetworksSampleDriver_server_defaults"], 79 init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-float-fast.rc"], 80 vintf_fragments: ["config/android.hardware.neuralnetworks@1.3-service-sample-float-fast.xml"], 81} 82 83cc_binary { 84 name: "android.hardware.neuralnetworks@1.3-service-sample-float-xnnpack", 85 srcs: ["SampleDriverFloatXNNPACK.cpp"], 86 defaults: ["NeuralNetworksSampleDriver_server_defaults"], 87 init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-float-xnnpack.rc"], 88 vintf_fragments: [ 89 "config/android.hardware.neuralnetworks@1.3-service-sample-float-xnnpack.xml", 90 ], 91 static_libs: [ 92 "libXNNPACK", 93 "libpthreadpool", 94 ], 95 cflags: [ 96 "-Wno-unused-parameter", 97 ], 98} 99 100cc_binary { 101 name: "android.hardware.neuralnetworks@1.3-service-sample-float-slow", 102 srcs: ["SampleDriverFloatSlow.cpp"], 103 defaults: ["NeuralNetworksSampleDriver_server_defaults"], 104 init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-float-slow.rc"], 105 vintf_fragments: ["config/android.hardware.neuralnetworks@1.3-service-sample-float-slow.xml"], 106} 107 108cc_binary { 109 name: "android.hardware.neuralnetworks@1.3-service-sample-quant", 110 srcs: ["SampleDriverQuant.cpp"], 111 defaults: ["NeuralNetworksSampleDriver_server_defaults"], 112 init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-quant.rc"], 113 vintf_fragments: ["config/android.hardware.neuralnetworks@1.3-service-sample-quant.xml"], 114} 115 116cc_binary { 117 name: "android.hardware.neuralnetworks@1.3-service-sample-minimal", 118 srcs: ["SampleDriverMinimal.cpp"], 119 defaults: ["NeuralNetworksSampleDriver_server_defaults"], 120 init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-minimal.rc"], 121 vintf_fragments: ["config/android.hardware.neuralnetworks@1.3-service-sample-minimal.xml"], 122} 123 124cc_library_static { 125 name: "libSampleDriver", 126 defaults: ["NeuralNetworksSampleDriver_defaults"], 127 export_include_dirs: ["."], 128} 129 130cc_library_static { 131 name: "neuralnetworks_canonical_sample_driver", 132 defaults: ["neuralnetworks_defaults"], 133 vendor_available: true, 134 // b/109953668, disable OpenMP 135 // openmp: true, 136 srcs: [ 137 "Canonical*.cpp", 138 "LimitedSupportDevice.cpp", 139 ], 140 header_libs: ["libneuralnetworks_headers"], 141 export_include_dirs: ["."], 142 static_libs: ["libneuralnetworks_common"], 143 shared_libs: [ 144 "libbase", 145 "libnativewindow", 146 ], 147} 148 149cc_library_shared { 150 name: "neuralnetworks_sample_sl_driver", 151 defaults: ["neuralnetworks_defaults"], 152 srcs: ["SampleDriverSL.cpp"], 153 shared_libs: [ 154 "libbase", 155 "libcutils", 156 "liblog", 157 "libnativewindow", 158 ], 159 // Change the soname, this library will be added as cc_prebuilt_library_shared 160 // with different name to android.hardware.neuralnetworks-shim-service-sample 161 ldflags: [ 162 "-Wl,-soname,neuralnetworks_sample_sl_driver_prebuilt.so", 163 ], 164 static_libs: [ 165 "libbase_ndk", 166 "libcrypto_static", 167 "libneuralnetworks_common_cl_cpu", 168 "libtflite_static", 169 "neuralnetworks_canonical_sample_driver", 170 "neuralnetworks_types_cl", 171 ], 172 whole_static_libs: [ 173 "libneuralnetworks_cl", 174 ], 175} 176