Skip to content

Commit c6b9d34

Browse files
authored
Fix Cadence CPU runner CMake build
Differential Revision: D95846702 Pull Request resolved: pytorch#18021
1 parent 7b5c60d commit c6b9d34

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

backends/cadence/build_cadence_runner.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,19 @@ main() {
3131

3232
local example_dir=backends/cadence
3333
local build_dir="cmake-out/${example_dir}"
34-
local cmake_prefix_path="${PWD}/cmake-out/lib/cmake/ExecuTorch;${PWD}/cmake-out/third-party/gflags"
34+
# Detect lib vs lib64
35+
if [ -d "${PWD}/cmake-out/lib64/cmake/ExecuTorch" ]; then
36+
libdir="lib64"
37+
else
38+
libdir="lib"
39+
fi
40+
local cmake_prefix_path="${PWD}/cmake-out/${libdir}/cmake/ExecuTorch;${PWD}/cmake-out/third-party/gflags"
3541
rm -rf ${build_dir}
3642
CXXFLAGS="-fno-exceptions -fno-rtti" cmake -DCMAKE_PREFIX_PATH="${cmake_prefix_path}" \
3743
-DCMAKE_BUILD_TYPE=Release \
3844
-DEXECUTORCH_CADENCE_CPU_RUNNER=ON \
3945
-DEXECUTORCH_ENABLE_LOGGING=ON \
46+
-DPYTHON_EXECUTABLE="$(which python3)" \
4047
-B"${build_dir}" \
4148
"${example_dir}"
4249
cmake --build "${build_dir}" --config Release -j16

backends/cadence/generic/operators/CMakeLists.txt

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,9 @@ target_include_directories(
7979
)
8080

8181
# Custom ops that are needed to run the test model.
82-
add_library(
83-
custom_ops
84-
"quantized_add_out.cpp"
85-
"quantized_linear_out.cpp"
86-
"quantized_conv2d_nchw_out.cpp"
87-
"quantized_conv2d_nhwc_out.cpp"
88-
"quantized_relu_out.cpp"
89-
"quantized_layer_norm.cpp"
90-
"quantize_per_tensor.cpp"
91-
"quantized_fully_connected_out.cpp"
92-
"dequantize_per_tensor.cpp"
93-
"quantized_matmul_out.cpp"
94-
"op_requantize_out.cpp"
95-
"im2row_out.cpp"
96-
)
82+
file(GLOB custom_ops_srcs "*.cpp")
83+
add_library(custom_ops ${custom_ops_srcs})
84+
9785
target_include_directories(
9886
custom_ops PUBLIC ${ROOT_DIR}/.. ${CMAKE_BINARY_DIR}
9987
${_common_include_directories}

0 commit comments

Comments
 (0)