diff --git a/cmake/onnxruntime_unittests.cmake b/cmake/onnxruntime_unittests.cmake index 41983d63f6afe..60c82f2bd16c5 100644 --- a/cmake/onnxruntime_unittests.cmake +++ b/cmake/onnxruntime_unittests.cmake @@ -1325,6 +1325,9 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP) ${BENCHMARK_DIR}/layer_normalization.cc) target_include_directories(onnxruntime_benchmark PRIVATE ${ONNXRUNTIME_ROOT} ${onnxruntime_graph_header} ${ONNXRUNTIME_ROOT}/core/mlas/inc) target_compile_definitions(onnxruntime_benchmark PRIVATE BENCHMARK_STATIC_DEFINE) + if (onnxruntime_USE_SVE) + target_compile_definitions(onnxruntime_benchmark PRIVATE MLAS_USE_SVE) + endif() if(WIN32) target_compile_options(onnxruntime_benchmark PRIVATE "$<$:SHELL:--compiler-options /wd4141>" "$<$>:/wd4141>") @@ -1352,6 +1355,9 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP) target_include_directories(onnxruntime_mlas_benchmark PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc) target_link_libraries(onnxruntime_mlas_benchmark PRIVATE benchmark::benchmark onnxruntime_util ${ONNXRUNTIME_MLAS_LIBS} onnxruntime_common ${CMAKE_DL_LIBS}) target_compile_definitions(onnxruntime_mlas_benchmark PRIVATE BENCHMARK_STATIC_DEFINE) + if (onnxruntime_USE_SVE) + target_compile_definitions(onnxruntime_mlas_benchmark PRIVATE MLAS_USE_SVE) + endif() if(WIN32) target_link_libraries(onnxruntime_mlas_benchmark PRIVATE debug Dbghelp) # Avoid using new and delete. But this is a benchmark program, it's ok if it has a chance to leak. @@ -1649,6 +1655,9 @@ endif() XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "NO" ) endif() + if (onnxruntime_USE_SVE) + target_compile_definitions(onnxruntime_mlas_test PRIVATE MLAS_USE_SVE) + endif() target_include_directories(onnxruntime_mlas_test PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc ${ONNXRUNTIME_ROOT} ${CMAKE_CURRENT_BINARY_DIR}) target_link_libraries(onnxruntime_mlas_test PRIVATE GTest::gtest GTest::gmock ${ONNXRUNTIME_MLAS_LIBS} onnxruntime_common)