Skip to content

Commit a697b0b

Browse files
committed
first crack at optimized op_where
ghstack-source-id: ebe8bee4e3ca4184e91058bd7033e69e130644da ghstack-comment-id: 2691805026 Pull Request resolved: #8861
1 parent 7254871 commit a697b0b

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

backends/xnnpack/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ if(NOT CMAKE_TOOLCHAIN_FILE MATCHES ".*(iOS|ios\.toolchain)\.cmake$")
139139
endif()
140140

141141
target_link_libraries(
142-
xnn_executor_runner gflags portable_ops_lib ${xnn_executor_runner_libs}
142+
xnn_executor_runner gflags optimized_native_cpu_ops_lib ${xnn_executor_runner_libs}
143143
)
144144
target_compile_options(xnn_executor_runner PUBLIC ${_common_compile_options})
145145
endif()

kernels/optimized/cpu/targets.bzl

+6
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ _OPTIMIZED_ATEN_OPS = (
9595
"//executorch/kernels/portable/cpu/util:broadcast_util",
9696
],
9797
),
98+
op_target(
99+
name = "op_where",
100+
deps = [
101+
"//executorch/kernels/portable/cpu/util:elementwise_util",
102+
],
103+
),
98104
)
99105

100106

kernels/optimized/optimized.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,8 @@
101101
kernels:
102102
- arg_meta: null
103103
kernel_name: torch::executor::opt_sub_scalar_out
104+
105+
- op: where.self_out
106+
kernels:
107+
- arg_meta: null
108+
kernel_name: torch::executor::opt_where_out

kernels/test/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ set(_optimized_kernels_test_sources
275275
"op_native_layer_norm_test.cpp"
276276
"op_neg_test.cpp"
277277
"op_sub_test.cpp"
278+
"op_where_test.cpp"
278279
"UnaryUfuncRealHBBF16ToFloatHBF16Test.cpp"
279280
${CMAKE_CURRENT_BINARY_DIR}/include/optimized/executorch/kernels/test/supported_features.cpp
280281
)

0 commit comments

Comments
 (0)