BUILD.bazel 1.7 KB
Newer Older
L
Liangliang He 已提交
1 2 3 4 5 6 7 8 9 10 11
package(
    default_visibility = ["//visibility:public"],
)

licenses(["notice"])  # Apache 2.0

load(
    "//mace:mace.bzl",
    "if_android",
    "if_android_armv7",
    "if_hexagon_enabled",
B
Bin Li 已提交
12
    "if_hta_enabled",
L
Liangliang He 已提交
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
    "if_neon_enabled",
    "if_opencl_enabled",
    "if_openmp_enabled",
    "if_quantize_enabled",
)

cc_test(
    name = "mace_cc_test",
    testonly = 1,
    srcs = glob(
        [
            "mace/libmace/*.cc",
            "mace/ops/*.cc",
            "mace/port/*.cc",
            "mace/utils/*.cc",
        ],
        exclude = [
            "mace/ops/fixpoint_test.cc",
        ],
    ) + if_neon_enabled(glob(
        [
            "mace/ops/arm/fp32/*.cc",
        ]
    )) + if_quantize_enabled(glob(
        [
            "mace/ops/arm/q8/*.cc",
            "mace/ops/fixpoint_test.cc",
        ]
    )) + if_opencl_enabled(glob(
        [
            "mace/ops/opencl/*.cc",
        ]
B
Bin Li 已提交
45 46 47
    )) + if_hta_enabled([
        "mace/core/runtime/hexagon/hta_transform_test.cc",
    ]),
L
Liangliang He 已提交
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
    copts = [
        "-Werror",
        "-Wextra",
        "-Wno-missing-field-initializers",
    ] + if_openmp_enabled([
        "-fopenmp",
    ]) + if_neon_enabled([
        "-DMACE_ENABLE_NEON",
    ]) + if_android_armv7([
        "-mfpu=neon-fp16",
        "-mfloat-abi=softfp",
    ]) + if_opencl_enabled([
        "-DMACE_ENABLE_OPENCL",
    ]) + if_quantize_enabled([
        "-DMACE_ENABLE_QUANTIZE",
    ]) + if_hexagon_enabled([
        "-DMACE_ENABLE_HEXAGON",
B
Bin Li 已提交
65 66
    ]) + if_hta_enabled([
        "-DMACE_ENABLE_HTA",
L
Liangliang He 已提交
67 68 69 70 71 72 73 74 75 76 77
    ]),
    linkopts = if_openmp_enabled([
        "-fopenmp",
    ]),
    linkstatic = 1,
    deps = [
        "//mace/ops",
        "//test/ccutils",
        "@gtest//:gtest_main",
    ],
)