blob: 96188d64ac25cf96119010fc31c487ba4f848985 [file] [log] [blame]
Jean-Luc Brouillet86c05692017-07-03 17:45:36 -07001/*
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
Bob Badourb12f1782021-02-26 03:03:27 -080017package {
Bob Badour58f681f2022-01-24 17:45:12 -080018 default_applicable_licenses: [
19 "packages_modules_NeuralNetworks_license",
20 ],
Bob Badourb12f1782021-02-26 03:03:27 -080021}
22
Bob Badourb12f1782021-02-26 03:03:27 -080023// See: http://go/android-license-faq
24license {
25 name: "packages_modules_NeuralNetworks_license",
Bob Badour58f681f2022-01-24 17:45:12 -080026 package_name: "Android Neural Networks API",
Bob Badourb12f1782021-02-26 03:03:27 -080027 visibility: [":__subpackages__"],
28 license_kinds: [
29 "SPDX-license-identifier-Apache-2.0",
Bob Badourb12f1782021-02-26 03:03:27 -080030 "SPDX-license-identifier-BSD",
Bob Badourb12f1782021-02-26 03:03:27 -080031 ],
Bob Badour58f681f2022-01-24 17:45:12 -080032 license_text: [
33 "LICENSE",
34 "LICENSE_BSD",
35 ],
Bob Badourb12f1782021-02-26 03:03:27 -080036}
37
Jean-Luc Brouilleta09d6992017-07-12 01:37:27 -070038cc_defaults {
David Grossc0ed40b2019-12-20 14:21:58 -080039 name: "neuralnetworks_float16",
Ray Hernandeza8564282021-08-11 21:29:20 +000040 // Note: the newlines in the "cflags" sections are intentional to ensure
41 // bpfmt -w -s does not change the order of the compiler flags.
David Grossc0ed40b2019-12-20 14:21:58 -080042 arch: {
43 x86: {
Ray Hernandeza8564282021-08-11 21:29:20 +000044 cflags: [
45 "-D_Float16=__fp16",
46
47 "-Xclang",
48 "-fnative-half-type",
49
50 "-Xclang",
51 "-fallow-half-arguments-and-returns",
52 ],
David Grossc0ed40b2019-12-20 14:21:58 -080053 },
54 x86_64: {
Ray Hernandeza8564282021-08-11 21:29:20 +000055 cflags: [
56 "-D_Float16=__fp16",
57
58 "-Xclang",
59 "-fnative-half-type",
60
61 "-Xclang",
62 "-fallow-half-arguments-and-returns",
63 ],
David Grossc0ed40b2019-12-20 14:21:58 -080064 },
65 },
66}
67
68cc_defaults {
Jean-Luc Brouilleta09d6992017-07-12 01:37:27 -070069 name: "neuralnetworks_defaults",
David Grossc0ed40b2019-12-20 14:21:58 -080070 defaults: ["neuralnetworks_float16"],
Jean-Luc Brouilleta09d6992017-07-12 01:37:27 -070071 cflags: [
David Gross21f8b712017-12-11 15:54:18 -080072 "-O3",
Michael Butler4aba01d2019-07-26 12:33:07 -070073 "-Wall",
74 "-Werror",
75 "-Wextra",
Jean-Luc Brouilleta09d6992017-07-12 01:37:27 -070076 ],
jaishank435f0422019-06-03 14:40:27 +053077 arch: {
78 x86: {
79 avx2: {
Michael Butler4aba01d2019-07-26 12:33:07 -070080 cflags: [
81 "-mavx2",
82 "-mfma",
83 ],
jaishank435f0422019-06-03 14:40:27 +053084 },
85 },
86 x86_64: {
87 avx2: {
Michael Butler4aba01d2019-07-26 12:33:07 -070088 cflags: [
89 "-mavx2",
90 "-mfma",
91 ],
jaishank435f0422019-06-03 14:40:27 +053092 },
93 },
94 },
David Grossc6224952017-09-22 12:29:04 -070095 product_variables: {
Michael Butler4aba01d2019-07-26 12:33:07 -070096 debuggable: { // eng and userdebug builds
David Grossc6224952017-09-22 12:29:04 -070097 cflags: ["-DNN_DEBUGGABLE"],
98 },
99 },
Jean-Luc Brouilleta09d6992017-07-12 01:37:27 -0700100}