xref: /aosp_15_r20/external/tensorflow/tensorflow/lite/kernels/Android.bp (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1// Copyright (C) 2017 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    // See: http://go/android-license-faq
17    // A large-scale-change added 'default_applicable_licenses' to import
18    // all of the 'license_kinds' from "external_tensorflow_license"
19    // to get the below license kinds:
20    //   SPDX-license-identifier-Apache-2.0
21    default_applicable_licenses: ["external_tensorflow_license"],
22}
23
24cc_library_static {
25    name: "libtflite_kernel_utils",
26    defaults: ["tflite_defaults"],
27    vendor_available: true,
28    min_sdk_version: "apex_inherit",
29    apex_available: [
30        "//apex_available:platform",
31        "com.android.neuralnetworks",
32        "test_com.android.neuralnetworks",
33    ],
34    srcs: [
35        "internal/optimized/neon_tensor_utils.cc",
36        "internal/optimized/sse_tensor_utils.cc",
37        "internal/quantization_util.cc",
38        "internal/reference/portable_tensor_utils.cc",
39        "internal/tensor_utils.cc",
40        "internal/transpose_utils.cc",
41        "kernel_util.cc",
42    ],
43    header_libs: [
44        "flatbuffer_headers",
45        "gemmlowp_headers",
46        "libeigen",
47    ],
48    static_libs: [
49        "libruy_static",
50    ],
51    cflags: [
52        "-Wno-extern-c-compat",
53        "-Wno-sign-compare",
54        "-Wno-unused-function",
55    ],
56}
57
58cc_library_static {
59    name: "libtflite_kernels",
60    defaults: ["tflite_defaults"],
61    srcs: [
62        "activations.cc",
63        "add.cc",
64        "add_n.cc",
65        "arg_min_max.cc",
66        "atan2.cc",
67        "basic_rnn.cc",
68        "batch_matmul.cc",
69        "batch_to_space_nd.cc",
70        "bidirectional_sequence_lstm.cc",
71        "bidirectional_sequence_rnn.cc",
72        "broadcast_to.cc",
73        "bucketize.cc",
74        "call_once.cc",
75        "cast.cc",
76        "ceil.cc",
77        "comparisons.cc",
78        "complex_support.cc",
79        "concatenation.cc",
80        "conv.cc",
81        "conv3d.cc",
82        "cumsum.cc",
83        "densify.cc",
84        "depth_to_space.cc",
85        "depthwise_conv.cc",
86        "dequantize.cc",
87        "detection_postprocess.cc",
88        "div.cc",
89        "dynamic_update_slice.cc",
90        "elementwise.cc",
91        "embedding_lookup.cc",
92        "embedding_lookup_sparse.cc",
93        "exp.cc",
94        "expand_dims.cc",
95        "fake_quant.cc",
96        "fill.cc",
97        "floor.cc",
98        "floor_div.cc",
99        "floor_mod.cc",
100        "fully_connected.cc",
101        "gather.cc",
102        "gather_nd.cc",
103        "hashtable_lookup.cc",
104        "if.cc",
105        "internal/kernel_utils.cc",
106        "internal/optimized/cpu_check.cc",
107        "internal/optimized/neon_tensor_utils.cc",
108        "internal/optimized/sse_tensor_utils.cc",
109        "internal/quantization_util.cc",
110        "internal/reference/portable_tensor_utils.cc",
111        "internal/tensor_utils.cc",
112        "internal/transpose_utils.cc",
113        "kernel_util.cc",
114        "l2norm.cc",
115        "local_response_norm.cc",
116        "logical.cc",
117        "lsh_projection.cc",
118        "lstm.cc",
119        "lstm_eval.cc",
120        "matrix_diag.cc",
121        "matrix_set_diag.cc",
122        "maximum_minimum.cc",
123        "mirror_pad.cc",
124        "mul.cc",
125        "neg.cc",
126        "non_max_suppression.cc",
127        "numeric_verify.cc",
128        "one_hot.cc",
129        "pack.cc",
130        "pad.cc",
131        "pooling.cc",
132        "pow.cc",
133        "quantize.cc",
134        "random_uniform.cc",
135        "random_ops.cc",
136        "range.cc",
137        "rank.cc",
138        "reduce.cc",
139        "register.cc",
140        "reshape.cc",
141        "resize_bilinear.cc",
142        "resize_nearest_neighbor.cc",
143        "reverse.cc",
144        "reverse_sequence.cc",
145        "rfft2d.cc",
146        "round.cc",
147        "scatter_nd.cc",
148        "segment_sum.cc",
149        "select.cc",
150        "shape.cc",
151        "sign.cc",
152        "skip_gram.cc",
153        "slice.cc",
154        "space_to_batch_nd.cc",
155        "space_to_depth.cc",
156        "sparse_to_dense.cc",
157        "split.cc",
158        "split_v.cc",
159        "squared_difference.cc",
160        "squeeze.cc",
161        "strided_slice.cc",
162        "sub.cc",
163        "svdf.cc",
164        "tile.cc",
165        "topk_v2.cc",
166        "transpose.cc",
167        "transpose_conv.cc",
168        "unidirectional_sequence_lstm.cc",
169        "unidirectional_sequence_rnn.cc",
170        "unique.cc",
171        "unpack.cc",
172        "unsorted_segment.cc",
173        "where.cc",
174        "while.cc",
175        "zeros_like.cc",
176    ],
177    header_libs: [
178        "flatbuffer_headers",
179        "gemmlowp_headers",
180        "libeigen",
181        "libruy_headers",
182        "libtextclassifier_hash_headers",
183    ],
184    static_libs: [
185        "libfft2d",
186    ],
187    cflags: [
188        "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash",
189        "-Wno-array-bounds",
190        "-Wno-extern-c-compat",
191        "-Wno-ignored-attributes",
192        "-Wno-invalid-partial-specialization",
193        "-Wno-mismatched-tags",
194        "-Wno-missing-field-initializers",
195        "-Wno-sign-compare",
196        "-Wno-unused-function",
197        "-Wno-unused-local-typedef",
198        "-Wno-unused-private-field",
199        "-Wno-unused-variable",
200    ],
201}
202