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    // Inherits all licenses from parent to get Apache 2.0 and package name
19    default_applicable_licenses: [
20        "packages_modules_NeuralNetworks_license",
21    ],
22}
23
24cc_defaults {
25    name: "NeuralNetworksSampleDriver_defaults",
26    defaults: ["neuralnetworks_defaults"],
27    host_supported: true,
28    // b/109953668, disable OpenMP
29    // openmp: true,
30    srcs: [
31        "SampleDriver.cpp",
32        "SampleDriverFull.cpp",
33        "SampleDriverPartial.cpp",
34        "SampleDriverUtils.cpp",
35    ],
36    header_libs: [
37        "libneuralnetworks_headers",
38    ],
39    shared_libs: [
40        "android.hardware.neuralnetworks@1.0",
41        "android.hardware.neuralnetworks@1.1",
42        "android.hardware.neuralnetworks@1.2",
43        "android.hardware.neuralnetworks@1.3",
44        "libbase",
45        "libcutils",
46        "libfmq",
47        "libhidlbase",
48        "libhidlmemory",
49        "liblog",
50        "libtextclassifier_hash",
51        "libutils",
52    ],
53    static_libs: [
54        "libneuralnetworks_common",
55    ],
56    target: {
57        android: {
58            shared_libs: [
59                "libhardware",
60                "libnativewindow",
61            ],
62        },
63        host: {
64            cflags: [
65                "-D__INTRODUCED_IN(n)=",
66            ],
67        },
68    },
69}
70
71cc_defaults {
72    name: "NeuralNetworksSampleDriver_server_defaults",
73    defaults: ["NeuralNetworksSampleDriver_defaults"],
74    host_supported: false,
75    relative_install_path: "hw",
76    proprietary: true,
77}
78
79cc_binary {
80    name: "android.hardware.neuralnetworks@1.3-service-sample-all",
81    srcs: ["SampleDriverAll.cpp"],
82    defaults: ["NeuralNetworksSampleDriver_server_defaults"],
83    init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-all.rc"],
84    vintf_fragments: ["config/android.hardware.neuralnetworks@1.3-service-sample-all.xml"],
85}
86
87cc_binary {
88    name: "android.hardware.neuralnetworks@1.3-service-sample-float-xnnpack",
89    srcs: ["SampleDriverFloatXNNPACK.cpp"],
90    defaults: ["NeuralNetworksSampleDriver_server_defaults"],
91    init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-float-xnnpack.rc"],
92    vintf_fragments: [
93        "config/android.hardware.neuralnetworks@1.3-service-sample-float-xnnpack.xml",
94    ],
95    static_libs: [
96        "libXNNPACK",
97        "libpthreadpool",
98    ],
99    cflags: [
100        "-Wno-unused-parameter",
101    ],
102}
103
104cc_binary {
105    name: "android.hardware.neuralnetworks@1.3-service-sample-limited",
106    srcs: ["SampleDriverLimited.cpp"],
107    defaults: ["neuralnetworks_defaults"],
108    header_libs: [
109        "libneuralnetworks_headers",
110    ],
111    shared_libs: [
112        "android.hardware.neuralnetworks@1.0",
113        "android.hardware.neuralnetworks@1.1",
114        "android.hardware.neuralnetworks@1.2",
115        "android.hardware.neuralnetworks@1.3",
116        "libbase",
117        "libcutils",
118        "libdl",
119        "libfmq",
120        "libhardware",
121        "libhidlbase",
122        "libhidlmemory",
123        "liblog",
124        "libnativewindow",
125        "libtextclassifier_hash",
126        "libutils",
127    ],
128    static_libs: [
129        "libneuralnetworks_common",
130        "neuralnetworks_canonical_sample_driver",
131        "neuralnetworks_utils_hal_adapter",
132    ],
133    relative_install_path: "hw",
134    proprietary: true,
135    init_rc: ["config/android.hardware.neuralnetworks@1.3-service-sample-limited.rc"],
136    vintf_fragments: ["config/android.hardware.neuralnetworks@1.3-service-sample-limited.xml"],
137}
138
139cc_library_static {
140    name: "libSampleDriver",
141    defaults: ["NeuralNetworksSampleDriver_defaults"],
142    export_include_dirs: ["."],
143}
144