Jean-Luc Brouillet | 86c0569 | 2017-07-03 17:45:36 -0700 | [diff] [blame] | 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 | |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 17 | package { |
Bob Badour | 58f681f | 2022-01-24 17:45:12 -0800 | [diff] [blame] | 18 | default_applicable_licenses: [ |
| 19 | "packages_modules_NeuralNetworks_license", |
| 20 | ], |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 21 | } |
| 22 | |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 23 | // See: http://go/android-license-faq |
| 24 | license { |
| 25 | name: "packages_modules_NeuralNetworks_license", |
Bob Badour | 58f681f | 2022-01-24 17:45:12 -0800 | [diff] [blame] | 26 | package_name: "Android Neural Networks API", |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 27 | visibility: [":__subpackages__"], |
| 28 | license_kinds: [ |
| 29 | "SPDX-license-identifier-Apache-2.0", |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 30 | "SPDX-license-identifier-BSD", |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 31 | ], |
Bob Badour | 58f681f | 2022-01-24 17:45:12 -0800 | [diff] [blame] | 32 | license_text: [ |
| 33 | "LICENSE", |
| 34 | "LICENSE_BSD", |
| 35 | ], |
Bob Badour | b12f178 | 2021-02-26 03:03:27 -0800 | [diff] [blame] | 36 | } |
| 37 | |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 38 | cc_defaults { |
David Gross | c0ed40b | 2019-12-20 14:21:58 -0800 | [diff] [blame] | 39 | name: "neuralnetworks_float16", |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 40 | // 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 Gross | c0ed40b | 2019-12-20 14:21:58 -0800 | [diff] [blame] | 42 | arch: { |
| 43 | x86: { |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 44 | cflags: [ |
| 45 | "-D_Float16=__fp16", |
| 46 | |
| 47 | "-Xclang", |
| 48 | "-fnative-half-type", |
| 49 | |
| 50 | "-Xclang", |
| 51 | "-fallow-half-arguments-and-returns", |
| 52 | ], |
David Gross | c0ed40b | 2019-12-20 14:21:58 -0800 | [diff] [blame] | 53 | }, |
| 54 | x86_64: { |
Ray Hernandez | a856428 | 2021-08-11 21:29:20 +0000 | [diff] [blame] | 55 | cflags: [ |
| 56 | "-D_Float16=__fp16", |
| 57 | |
| 58 | "-Xclang", |
| 59 | "-fnative-half-type", |
| 60 | |
| 61 | "-Xclang", |
| 62 | "-fallow-half-arguments-and-returns", |
| 63 | ], |
David Gross | c0ed40b | 2019-12-20 14:21:58 -0800 | [diff] [blame] | 64 | }, |
| 65 | }, |
| 66 | } |
| 67 | |
| 68 | cc_defaults { |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 69 | name: "neuralnetworks_defaults", |
David Gross | c0ed40b | 2019-12-20 14:21:58 -0800 | [diff] [blame] | 70 | defaults: ["neuralnetworks_float16"], |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 71 | cflags: [ |
David Gross | 21f8b71 | 2017-12-11 15:54:18 -0800 | [diff] [blame] | 72 | "-O3", |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 73 | "-Wall", |
| 74 | "-Werror", |
| 75 | "-Wextra", |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 76 | ], |
jaishank | 435f042 | 2019-06-03 14:40:27 +0530 | [diff] [blame] | 77 | arch: { |
| 78 | x86: { |
| 79 | avx2: { |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 80 | cflags: [ |
| 81 | "-mavx2", |
| 82 | "-mfma", |
| 83 | ], |
jaishank | 435f042 | 2019-06-03 14:40:27 +0530 | [diff] [blame] | 84 | }, |
| 85 | }, |
| 86 | x86_64: { |
| 87 | avx2: { |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 88 | cflags: [ |
| 89 | "-mavx2", |
| 90 | "-mfma", |
| 91 | ], |
jaishank | 435f042 | 2019-06-03 14:40:27 +0530 | [diff] [blame] | 92 | }, |
| 93 | }, |
| 94 | }, |
David Gross | c622495 | 2017-09-22 12:29:04 -0700 | [diff] [blame] | 95 | product_variables: { |
Michael Butler | 4aba01d | 2019-07-26 12:33:07 -0700 | [diff] [blame] | 96 | debuggable: { // eng and userdebug builds |
David Gross | c622495 | 2017-09-22 12:29:04 -0700 | [diff] [blame] | 97 | cflags: ["-DNN_DEBUGGABLE"], |
| 98 | }, |
| 99 | }, |
Jean-Luc Brouillet | a09d699 | 2017-07-12 01:37:27 -0700 | [diff] [blame] | 100 | } |