Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4709,6 +4709,7 @@ xnnpack_cc_library(
"@pthreadpool",
] + select({
":emscripten": [],
":emscripten_tfjs_legacy": [],
"//conditions:default": ["@cpuinfo"],
}),
)
Expand Down Expand Up @@ -4751,6 +4752,7 @@ xnnpack_cc_library(
"@pthreadpool",
] + select({
":emscripten": [],
":emscripten_tfjs_legacy": [],
"//conditions:default": ["@cpuinfo"],
}),
)
Expand Down Expand Up @@ -4799,6 +4801,7 @@ xnnpack_cc_library(
"@pthreadpool",
] + select({
":emscripten": [],
":emscripten_tfjs_legacy": [],
"//conditions:default": ["@cpuinfo"],
}),
)
Expand Down Expand Up @@ -4840,6 +4843,7 @@ xnnpack_cc_library(
"@pthreadpool",
] + select({
":emscripten": [],
":emscripten_tfjs_legacy": [],
"//conditions:default": ["@cpuinfo"],
}),
)
Expand Down Expand Up @@ -7413,11 +7417,24 @@ config_setting(

config_setting(
name = "emscripten",
values = {"crosstool_top": "//emscripten_toolchain:everything"},
)

config_setting(
name = "emscripten_tfjs_legacy",
values = {"crosstool_top": "//toolchain:emscripten"},
)

config_setting(
name = "emscripten_wasm",
values = {
"crosstool_top": "//emscripten_toolchain:everything",
"cpu": "wasm",
},
)

config_setting(
name = "emscripten_wasm_tfjs_legacy",
values = {
"crosstool_top": "//toolchain:emscripten",
"cpu": "wasm",
Expand All @@ -7426,6 +7443,15 @@ config_setting(

config_setting(
name = "emscripten_wasmsimd",
values = {
"crosstool_top": "//emscripten_toolchain:everything",
"cpu": "wasm",
"copt": "-msimd128",
},
)

config_setting(
name = "emscripten_wasmsimd_tfjs_legacy",
values = {
"crosstool_top": "//toolchain:emscripten",
"cpu": "wasm",
Expand Down
13 changes: 13 additions & 0 deletions build_defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,9 @@ def xnnpack_cc_library(
":tvos_arm64": aarch64_srcs,
":tvos_x86_64": x86_srcs,
":emscripten_wasm": wasm_srcs,
":emscripten_wasm_tfjs_legacy": wasm_srcs,
":emscripten_wasmsimd": wasmsimd_srcs,
":emscripten_wasmsimd_tfjs_legacy": wasmsimd_srcs,
"//conditions:default": [],
}),
copts = [
Expand Down Expand Up @@ -200,7 +202,9 @@ def xnnpack_cc_library(
":tvos_arm64": aarch64_copts,
":tvos_x86_64": gcc_x86_copts,
":emscripten_wasm": wasm_copts,
":emscripten_wasm_tfjs_legacy": wasm_copts,
":emscripten_wasmsimd": wasmsimd_copts,
":emscripten_wasmsimd_tfjs_legacy": wasmsimd_copts,
"//conditions:default": [],
}) + select({
":windows_x86_64_clang": ["/clang:" + opt for opt in gcc_copts],
Expand Down Expand Up @@ -281,7 +285,9 @@ def xnnpack_aggregate_library(
":tvos_arm64": aarch64_deps,
":tvos_x86_64": x86_deps,
":emscripten_wasm": wasm_deps,
":emscripten_wasm_tfjs_legacy": wasm_deps,
":emscripten_wasmsimd": wasmsimd_deps,
":emscripten_wasmsimd_tfjs_legacy": wasmsimd_deps,
}),
)

Expand Down Expand Up @@ -324,13 +330,15 @@ def xnnpack_unit_test(name, srcs, copts = [], mingw_copts = [], msys_copts = [],
}) + copts,
linkopts = select({
":emscripten": xnnpack_emscripten_test_linkopts(),
":emscripten_tfjs_legacy": xnnpack_emscripten_test_linkopts(),
"//conditions:default": [],
}),
linkstatic = True,
deps = [
"@com_google_googletest//:gtest_main",
] + deps + select({
":emscripten": xnnpack_emscripten_deps(),
":emscripten_tfjs_legacy": xnnpack_emscripten_deps(),
"//conditions:default": [],
}),
tags = tags,
Expand All @@ -356,13 +364,15 @@ def xnnpack_unit_test(name, srcs, copts = [], mingw_copts = [], msys_copts = [],
}) + copts,
linkopts = select({
":emscripten": xnnpack_emscripten_test_linkopts(),
":emscripten_tfjs_legacy": xnnpack_emscripten_test_linkopts(),
"//conditions:default": [],
}),
linkstatic = True,
deps = [
"@com_google_googletest//:gtest_main",
] + deps + select({
":emscripten": xnnpack_emscripten_deps(),
":emscripten_tfjs_legacy": xnnpack_emscripten_deps(),
"//conditions:default": [],
}),
testonly = True,
Expand All @@ -389,6 +399,7 @@ def xnnpack_binary(name, srcs, copts = [], deps = []):
] + copts,
linkopts = select({
":emscripten": xnnpack_emscripten_minimal_linkopts(),
":emscripten_tfjs_legacy": xnnpack_emscripten_minimal_linkopts(),
"//conditions:default": [],
}),
linkstatic = True,
Expand Down Expand Up @@ -423,6 +434,7 @@ def xnnpack_benchmark(name, srcs, copts = [], deps = [], tags = []):
}) + copts,
linkopts = select({
":emscripten": xnnpack_emscripten_benchmark_linkopts(),
":emscripten_tfjs_legacy": xnnpack_emscripten_benchmark_linkopts(),
":windows_x86_64_mingw": ["-lshlwapi"],
":windows_x86_64_msys": ["-lshlwapi"],
"//conditions:default": [],
Expand All @@ -432,6 +444,7 @@ def xnnpack_benchmark(name, srcs, copts = [], deps = [], tags = []):
"@com_google_benchmark//:benchmark",
] + deps + select({
":emscripten": xnnpack_emscripten_deps(),
":emscripten_tfjs_legacy": xnnpack_emscripten_deps(),
"//conditions:default": [],
}),
tags = tags,
Expand Down
6 changes: 6 additions & 0 deletions third_party/cpuinfo.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ cc_library(
":tvos_x86_64": COMMON_SRCS + X86_SRCS + MACH_SRCS + MACH_X86_SRCS,
":tvos_arm64": COMMON_SRCS + MACH_SRCS + MACH_ARM_SRCS,
":emscripten": COMMON_SRCS + EMSCRIPTEN_SRCS,
":emscripten_tfjs_legacy": COMMON_SRCS + EMSCRIPTEN_SRCS,
}),
copts = select({
":windows_x86_64": [],
Expand Down Expand Up @@ -334,5 +335,10 @@ config_setting(

config_setting(
name = "emscripten",
values = {"crosstool_top": "//emscripten_toolchain:everything"},
)

config_setting(
name = "emscripten_tfjs_legacy",
values = {"crosstool_top": "//toolchain:emscripten"},
)