Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0db1b54e authored by David Gross's avatar David Gross
Browse files

redefine _Float16 as __fp16 for x86[_64] to allow removing workaround from inhouse clang

At present, the tests might not actually use _Float16 (the generated
tests that are incorporated into the functional tests are built in
frameworks/ml rather than in hardware/interfaces); but the makefiles
are changed anyway, in case _Float16 is added in the future.

Bug: 138709788

Test: for (walleye, aosp_x86 [on emulator], aosp_x86_64 [on emulator])
        Use clang where _Float16 is disabled for x86[_64]
        $ cd $ANDROID_BUILD_TOP/neuralnetworks/1.0/vts/functional
        inspect build commands for tests as to whether or not
          expected options related to redefinition are present
        $ cd $ANDROID_BUILD_TOP/neuralnetworks/1.1/vts/functional
        inspect build commands for tests as to whether or not
          expected options related to redefinition are present

Change-Id: I9225b228947696d249771b3a35b1f82de9c26b6e
(cherry picked from commit 2452ee5a)
parent d1fa5833
Loading
Loading
Loading
Loading
+19 −2
Original line number Diff line number Diff line
@@ -14,13 +14,30 @@
// limitations under the License.
//

cc_defaults {
    name: "neuralnetworks_vts_functional_defaults",
    defaults: ["VtsHalTargetTestDefaults"],
    arch: {
        x86: {
            cflags: [ "-D_Float16=__fp16",
                      "-Xclang", "-fnative-half-type",
                      "-Xclang", "-fallow-half-arguments-and-returns" ],
        },
        x86_64: {
            cflags: [ "-D_Float16=__fp16",
                      "-Xclang", "-fnative-half-type",
                      "-Xclang", "-fallow-half-arguments-and-returns" ],
        },
    },
}

cc_library_static {
    name: "VtsHalNeuralNetworksV1_0_utils",
    srcs: [
        "Callbacks.cpp",
        "Utils.cpp",
    ],
    defaults: ["VtsHalTargetTestDefaults"],
    defaults: ["neuralnetworks_vts_functional_defaults"],
    export_include_dirs: ["include"],
    shared_libs: [
        "libfmq",
@@ -42,7 +59,7 @@ cc_library_static {

cc_test {
    name: "VtsHalNeuralnetworksV1_0TargetTest",
    defaults: ["VtsHalTargetTestDefaults"],
    defaults: ["neuralnetworks_vts_functional_defaults"],
    srcs: [
        "BasicTests.cpp",
        "TestAssertions.cpp",
+1 −1
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

cc_test {
    name: "VtsHalNeuralnetworksV1_1TargetTest",
    defaults: ["VtsHalTargetTestDefaults"],
    defaults: ["neuralnetworks_vts_functional_defaults"],
    srcs: [
        "BasicTests.cpp",
        "TestAssertions.cpp",
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

cc_library_static {
    name: "VtsHalNeuralNetworksV1_2Callbacks",
    defaults: ["VtsHalTargetTestDefaults"],
    defaults: ["neuralnetworks_vts_functional_defaults"],
    export_include_dirs: ["include"],
    srcs: [
        "Callbacks.cpp",
@@ -33,7 +33,7 @@ cc_library_static {

cc_test {
    name: "VtsHalNeuralnetworksV1_2TargetTest",
    defaults: ["VtsHalTargetTestDefaults"],
    defaults: ["neuralnetworks_vts_functional_defaults"],
    srcs: [
        "BasicTests.cpp",
        "CompilationCachingTests.cpp",
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

cc_library_static {
    name: "VtsHalNeuralNetworksV1_3_utils",
    defaults: ["VtsHalTargetTestDefaults"],
    defaults: ["neuralnetworks_vts_functional_defaults"],
    export_include_dirs: ["include"],
    srcs: [
        "Callbacks.cpp",
@@ -35,7 +35,7 @@ cc_library_static {

cc_test {
    name: "VtsHalNeuralnetworksV1_3TargetTest",
    defaults: ["VtsHalTargetTestDefaults"],
    defaults: ["neuralnetworks_vts_functional_defaults"],
    srcs: [
        "BasicTests.cpp",
        "CompilationCachingTests.cpp",