• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright 2021 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
17// package has name collision with other module, must use licenses in targets
18// Inherits all licenses from parent to get Apache 2.0 and package name.
19// package {
20//     default_applicable_licenses: ["packages_modules_NeuralNetworks_license"],
21// }
22
23cc_library_headers {
24    name: "neuralnetworks_supportlibrary_types_ndk",
25    host_supported: false,
26    export_include_dirs: ["public"],
27    licenses: ["packages_modules_NeuralNetworks_license"],
28    sdk_version: "current",
29    vendor_available: true,
30    min_sdk_version: "29",
31}
32
33/** Version of the shim (Adapter between SL/Updatable Driver and sAIDL service)
34 * intended to be used by a non-updatable (without an OTA) NNAPI vendor drivers
35 * backed by a SL/Updatable Driver.
36 */
37package {
38    default_applicable_licenses: ["packages_modules_NeuralNetworks_license"],
39}
40
41cc_library_static {
42    name: "libneuralnetworks_shim_static",
43    defaults: [
44        "neuralnetworks_use_latest_utils_hal_aidl",
45    ],
46    apex_available: [
47        "//apex_available:platform",
48        "com.android.neuralnetworks",
49    ],
50    srcs: [
51        "NeuralNetworksShim.cpp",
52        "ShimBufferTracker.cpp",
53        "ShimConverter.cpp",
54        "ShimDevice.cpp",
55        "ShimDeviceManager.cpp",
56        "ShimPreparedModel.cpp",
57        "ShimUtils.cpp",
58    ],
59    licenses: ["packages_modules_NeuralNetworks_license"],
60    vendor_available: true,
61    min_sdk_version: "30",
62    cflags: [
63        // Needed by neuralnetworks_supportlibrary_loader
64        // Should be removed after doing b/117845862
65        "-DNNTEST_SLTS",
66        "-DNN_COMPATIBILITY_LIBRARY_BUILD",
67        "-Wall",
68        "-Werror",
69    ],
70    header_libs: [
71        "libneuralnetworks_headers",
72    ],
73    local_include_dirs: [
74        "include",
75    ],
76    static_libs: [
77        "libaidlcommonsupport",
78        "libarect",
79        "libcutils",
80        "libneuralnetworks_common",
81        "neuralnetworks_supportlibrary_loader",
82        "neuralnetworks_utils_hal_common",
83    ],
84    shared_libs: [
85        "libbase",
86        "libbinder_ndk",
87        "libhidlbase",
88        "libhidlmemory",
89        "liblog",
90        "libnativewindow",
91    ],
92    export_include_dirs: [
93        "public",
94    ],
95}
96
97cc_library_static {
98    name: "neuralnetworks_supportlibrary_loader",
99    host_supported: false,
100    srcs: [
101        "SupportLibrary.cpp",
102        "SupportLibraryWrapper.cpp",
103    ],
104    shared_libs: [
105        "libnativewindow",
106    ],
107    cflags: [
108        "-DNNTEST_COMPUTE_MODE",
109        "-DNNTEST_ONLY_PUBLIC_API",
110        "-DNNTEST_SLTS",
111        "-DNN_COMPATIBILITY_LIBRARY_BUILD",
112        "-Wall",
113        "-Werror",
114    ],
115    apex_available: [
116        "//apex_available:platform",
117        "com.android.neuralnetworks",
118    ],
119    export_include_dirs: [
120        "include",
121        "public",
122    ],
123    static_libs: [
124        "libarect",
125        "libbase",
126    ],
127    licenses: ["packages_modules_NeuralNetworks_license"],
128    vendor_available: true,
129    min_sdk_version: "29",
130    header_libs: [
131        "libneuralnetworks_headers",
132    ],
133}
134