@@ -49,13 +49,22 @@ prepare_artifacts_upload() {
4949}
5050
5151build_cmake_executor_runner () {
52+ local backend_string_select=" ${1:- } "
5253 echo " Building executor_runner"
5354 rm -rf ${CMAKE_OUTPUT_DIR}
54- cmake -DCMAKE_BUILD_TYPE=Debug \
55- -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
56- -DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE " \
57- -B${CMAKE_OUTPUT_DIR} .
58-
55+ if [[ " $backend_string_select " == " XNNPACK" ]]; then
56+ echo " Backend $backend_string_select selected"
57+ cmake -DCMAKE_BUILD_TYPE=Debug \
58+ -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
59+ -DEXECUTORCH_BUILD_XNNPACK=ON \
60+ -DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE " \
61+ -B${CMAKE_OUTPUT_DIR} .
62+ else
63+ cmake -DCMAKE_BUILD_TYPE=Debug \
64+ -DEXECUTORCH_BUILD_KERNELS_OPTIMIZED=ON \
65+ -DPYTHON_EXECUTABLE=" $PYTHON_EXECUTABLE " \
66+ -B${CMAKE_OUTPUT_DIR} .
67+ fi
5968 cmake --build ${CMAKE_OUTPUT_DIR} -j4 --config Debug
6069}
6170
@@ -135,10 +144,11 @@ test_model_with_xnnpack() {
135144
136145 # Run test model
137146 if [[ " ${BUILD_TOOL} " == " buck2" ]]; then
147+ # TODO eventually buck should also use consolidated executor runners
138148 buck2 run //examples/xnnpack:xnn_executor_runner -- --model_path " ${OUTPUT_MODEL_PATH} "
139149 elif [[ " ${BUILD_TOOL} " == " cmake" ]]; then
140150 if [[ ! -f ${CMAKE_OUTPUT_DIR} /executor_runner ]]; then
141- build_cmake_executor_runner
151+ build_cmake_executor_runner( " XNNPACK " )
142152 fi
143153 ./${CMAKE_OUTPUT_DIR} /executor_runner --model_path " ${OUTPUT_MODEL_PATH} "
144154 else
0 commit comments