Skip to content

Commit

Permalink
Rename TFLite- and TF.js- optimized targets
Browse files Browse the repository at this point in the history
Rename :xnnpack_f32 and :xnnpack_operators_nhwc_f32 into :xnnpack_for_tflite
and :xnnpack_for_tfjs respectively in preparation to future functionality
inside these targets.
PiperOrigin-RevId: 365913794
  • Loading branch information
Maratyszcza authored and xnnpack-bot committed Mar 30, 2021
1 parent 09c0591 commit f0cb70a
Showing 1 changed file with 54 additions and 2 deletions.
56 changes: 54 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4836,8 +4836,60 @@ xnnpack_cc_library(
}),
)

# Specialized XNNPACK version for TensorFlow Lite. Excludes operators currently
# not used by the TensorFlow Lite XNNPACK delegate to minimize code size.
xnnpack_cc_library(
name = "xnnpack_operators_nhwc_f32",
name = "xnnpack_for_tflite",
srcs = [
"src/init.c",
"src/runtime.c",
"src/subgraph.c",
"src/tensor.c",
] + SUBGRAPH_SRCS,
hdrs = ["include/xnnpack.h"],
copts = LOGGING_COPTS + [
"-Isrc",
"-Iinclude",
] + select({
":debug_build": [],
"//conditions:default": xnnpack_min_size_copts(),
}) + select({
":xnn_enable_hmp_explicit_false": ["-DXNN_MAX_UARCH_TYPES=1"],
"//conditions:default": [],
}),
defines = [
"XNN_NO_QS8_OPERATORS",
"XNN_NO_QU8_OPERATORS",
"XNN_NO_U8_OPERATORS",
"XNN_NO_X8_OPERATORS",
"XNN_NO_F16_OPERATORS",
"XNN_NO_X16_OPERATORS",
],
gcc_copts = xnnpack_gcc_std_copts(),
includes = ["include"],
msvc_copts = xnnpack_msvc_std_copts(),
visibility = xnnpack_visibility(),
deps = [
":enable_assembly",
":enable_sparse",
":logging_utils",
":memory_planner",
":operator_run",
":operators",
":ukernels_max_compatibility",
"@clog",
"@FP16",
"@pthreadpool",
] + select({
":emscripten": [],
"//conditions:default": ["@cpuinfo"],
}),
)

# Specialized XNNPACK version for TensorFlow.js. Excludes operators currently
# not used by the TensorFlow.js WebAssembly backend to minimize code size.
xnnpack_cc_library(
name = "xnnpack_for_tfjs",
srcs = [
"src/init.c",
],
Expand Down Expand Up @@ -6953,7 +7005,7 @@ xnnpack_unit_test(
xnnpack_binary(
name = "operator_size_test",
srcs = ["test/operator-size.c"],
deps = [":xnnpack_operators_nhwc_f32"],
deps = [":xnnpack_for_tfjs"],
)

xnnpack_binary(
Expand Down

0 comments on commit f0cb70a

Please sign in to comment.