Skip to content

Commit

Permalink
Run build_cleaner tool on BUILD rules to make implicit deps explicit …
Browse files Browse the repository at this point in the history
…in the build graph for C/C++ libraries (plus by some manual cleanup).

PiperOrigin-RevId: 660095736
  • Loading branch information
xnnpack-bot committed Aug 6, 2024
1 parent a32dc8f commit 16ffec5
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 67 deletions.
43 changes: 42 additions & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,15 @@ xnnpack_cc_library(
hdrs = INTERNAL_MICROKERNEL_HDRS,
gcc_copts = xnnpack_gcc_std_copts(),
msvc_copts = xnnpack_msvc_std_copts(),
deps = [
":common",
":config_hdrs",
":memory",
":microparams",
":mutex",
":xnnpack_h",
"@FP16",
],
)

xnnpack_cc_library(
Expand Down Expand Up @@ -355,6 +364,10 @@ xnnpack_cc_library(
hdrs = ["src/xnnpack/init-once.h"],
gcc_copts = xnnpack_gcc_std_copts(),
msvc_copts = xnnpack_msvc_std_copts(),
deps = [
":common",
":xnnpack_h",
],
)

xnnpack_cc_library(
Expand Down Expand Up @@ -441,7 +454,10 @@ xnnpack_cc_library(
"src/xnnpack/config.h",
"src/xnnpack/config-types.h",
],
deps = [":params"],
deps = [
":hardware_config",
":params",
],
)

xnnpack_cc_library(
Expand Down Expand Up @@ -587,34 +603,49 @@ xnnpack_cc_library(
hdrs = ["src/xnnpack/node-type.h"],
gcc_copts = xnnpack_gcc_std_copts(),
msvc_copts = xnnpack_msvc_std_copts(),
deps = [
":common",
],
)

xnnpack_cc_library(
name = "allocation_type",
hdrs = ["src/xnnpack/allocation-type.h"],
gcc_copts = xnnpack_gcc_std_copts(),
msvc_copts = xnnpack_msvc_std_copts(),
deps = [
":common",
],
)

xnnpack_cc_library(
name = "operator_type",
hdrs = ["src/xnnpack/operator-type.h"],
gcc_copts = xnnpack_gcc_std_copts(),
msvc_copts = xnnpack_msvc_std_copts(),
deps = [
":common",
],
)

xnnpack_cc_library(
name = "microkernel_type",
hdrs = ["src/xnnpack/microkernel-type.h"],
gcc_copts = xnnpack_gcc_std_copts(),
msvc_copts = xnnpack_msvc_std_copts(),
deps = [
":common",
],
)

xnnpack_cc_library(
name = "internal",
hdrs = ["src/xnnpack/internal.h"],
gcc_copts = xnnpack_gcc_std_copts(),
msvc_copts = xnnpack_msvc_std_copts(),
deps = [
":xnnpack_h",
],
)

xnnpack_cc_library(
Expand Down Expand Up @@ -1369,6 +1400,9 @@ xnnpack_cc_library(
wasm_srcs = WASM32_ASM_MICROKERNEL_SRCS,
wasmrelaxedsimd_srcs = WASM32_ASM_MICROKERNEL_SRCS,
wasmsimd_srcs = WASM32_ASM_MICROKERNEL_SRCS,
deps = [
":common",
],
)

xnnpack_cc_library(
Expand Down Expand Up @@ -2116,18 +2150,25 @@ xnnpack_cc_library(
":allocator",
":cache",
":common",
":config_hdrs",
":enable_jit",
":enable_sparse",
":hardware_config",
":internal",
":logging",
":math",
":memory",
":microkernel_type",
":microkernels_h",
":node_type",
":operator_type",
":operator_utils",
":operators",
":params",
":requantization",
":xnnpack_h",
"@FP16",
"@pthreadpool",
] + xnnpack_slinky_deps(),
)

Expand Down
27 changes: 20 additions & 7 deletions bench/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ xnnpack_cc_library(
"//:hardware_config",
"//:memory",
"//:params",
"//:xnnpack_h",
"@com_google_benchmark//:benchmark",
] + select({
"//:cpuinfo_enabled": ["@cpuinfo"],
Expand Down Expand Up @@ -505,13 +506,20 @@ xnnpack_benchmark(
deps = MICROKERNEL_BENCHMARK_DEPS,
)

cc_library(
name = "spmm",
hdrs = ["spmm.h"],
deps = [
"@com_google_benchmark//:benchmark",
],
)

xnnpack_benchmark(
name = "f16_spmm_bench",
srcs = [
"f16-spmm.cc",
"spmm.h",
],
deps = MICROKERNEL_BENCHMARK_DEPS,
deps = MICROKERNEL_BENCHMARK_DEPS + [":spmm"],
)

[xnnpack_benchmark(
Expand Down Expand Up @@ -868,9 +876,9 @@ xnnpack_benchmark(
name = "f32_spmm_bench",
srcs = [
"f32-spmm.cc",
"spmm.h",
],
deps = MICROKERNEL_BENCHMARK_DEPS + [
":spmm",
":spmm_benchmark",
],
)
Expand Down Expand Up @@ -1069,7 +1077,7 @@ xnnpack_cc_library(
hdrs = [
"rsum-benchmark.h",
],
deps = MICROKERNEL_BENCHMARK_DEPS,
deps = MICROKERNEL_BENCHMARK_DEPS + ["@com_google_benchmark//:benchmark"],
)

xnnpack_cc_library(
Expand All @@ -1079,7 +1087,11 @@ xnnpack_cc_library(
"gemm.h",
"gemm-benchmark.h",
],
deps = MICROKERNEL_BENCHMARK_DEPS,
deps = MICROKERNEL_BENCHMARK_DEPS + [
"//:config_hdrs",
"//:math",
"@com_google_benchmark//:benchmark",
],
)

xnnpack_cc_library(
Expand All @@ -1089,7 +1101,10 @@ xnnpack_cc_library(
"spmm-benchmark.h",
],
deps = MICROKERNEL_BENCHMARK_DEPS + [
":spmm",
"//:isa_checks",
"//:math",
"@com_google_benchmark//:benchmark",
],
)

Expand Down Expand Up @@ -1358,7 +1373,6 @@ xnnpack_benchmark(
deps = [
":bench_utils",
"//:XNNPACK",
"//:aligned_allocator",
"//:models_h",
"//models:fp16_mobilenet_v1",
"//models:fp16_mobilenet_v2",
Expand Down Expand Up @@ -1389,6 +1403,5 @@ xnnpack_benchmark(
"//models:qu8_mobilenet_v2",
"//models:qu8_mobilenet_v3_large",
"//models:qu8_mobilenet_v3_small",
"@pthreadpool",
],
)
Loading

0 comments on commit 16ffec5

Please sign in to comment.