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 default_applicable_licenses: [ 19 "packages_modules_NeuralNetworks_license", 20 ], 21} 22 23// See: http://go/android-license-faq 24license { 25 name: "packages_modules_NeuralNetworks_license", 26 package_name: "Android Neural Networks API", 27 visibility: [":__subpackages__"], 28 license_kinds: [ 29 "SPDX-license-identifier-Apache-2.0", 30 "SPDX-license-identifier-BSD", 31 ], 32 license_text: [ 33 "LICENSE", 34 "LICENSE_BSD", 35 ], 36} 37 38cc_defaults { 39 name: "neuralnetworks_float16", 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. 42 arch: { 43 x86: { 44 cflags: [ 45 "-D_Float16=__fp16", 46 47 "-Xclang", 48 "-fnative-half-type", 49 50 "-Xclang", 51 "-fallow-half-arguments-and-returns", 52 ], 53 }, 54 x86_64: { 55 cflags: [ 56 "-D_Float16=__fp16", 57 58 "-Xclang", 59 "-fnative-half-type", 60 61 "-Xclang", 62 "-fallow-half-arguments-and-returns", 63 ], 64 }, 65 }, 66} 67 68cc_defaults { 69 name: "neuralnetworks_defaults", 70 defaults: ["neuralnetworks_float16"], 71 cflags: [ 72 "-O3", 73 "-Wall", 74 "-Werror", 75 "-Wextra", 76 ], 77 arch: { 78 x86: { 79 avx2: { 80 cflags: [ 81 "-mavx2", 82 "-mfma", 83 ], 84 }, 85 }, 86 x86_64: { 87 avx2: { 88 cflags: [ 89 "-mavx2", 90 "-mfma", 91 ], 92 }, 93 }, 94 }, 95 product_variables: { 96 debuggable: { // eng and userdebug builds 97 cflags: ["-DNN_DEBUGGABLE"], 98 }, 99 }, 100} 101