From 002c9a8c7129f6faab25c59fd6150278bee06614 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Fri, 13 Sep 2024 22:02:02 +0800 Subject: [PATCH] update kleidiai --- cmake/external/xnnpack.cmake | 7 +-- cmake/patches/kleidiai/NoTestProjects.patch | 66 --------------------- 2 files changed, 3 insertions(+), 70 deletions(-) delete mode 100644 cmake/patches/kleidiai/NoTestProjects.patch diff --git a/cmake/external/xnnpack.cmake b/cmake/external/xnnpack.cmake index 386aa574fc400..f3eba8437505e 100644 --- a/cmake/external/xnnpack.cmake +++ b/cmake/external/xnnpack.cmake @@ -5,6 +5,8 @@ set(FP16_BUILD_TESTS OFF CACHE INTERNAL "") set(FP16_BUILD_BENCHMARKS OFF CACHE INTERNAL "") set(PTHREADPOOL_BUILD_TESTS OFF CACHE INTERNAL "") set(PTHREADPOOL_BUILD_BENCHMARKS OFF CACHE INTERNAL "") +set(KLEIDIAI_BUILD_TESTS OFF CACHE INTERNAL "") +set(KLEIDIAI_BUILD_BENCHMARK OFF CACHE INTERNAL "") if(CMAKE_SYSTEM_PROCESSOR MATCHES "^riscv64.*") set(XNNPACK_USE_SYSTEM_LIBS OFF) @@ -32,14 +34,11 @@ onnxruntime_fetchcontent_makeavailable(pthreadpool) # https://github.com/google/XNNPACK/blob/3b3f7b8a6668f6ab3b6ce33b9f1d1fce971549d1/CMakeLists.txt#L206C82-L206C117 if(CMAKE_SYSTEM_PROCESSOR MATCHES "^arm64.*" AND NOT CMAKE_C_COMPILER_ID STREQUAL "MSVC") - FetchContent_Declare(kleidiai URL ${DEP_URL_kleidiai} URL_HASH SHA1=${DEP_SHA1_kleidiai} - PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/kleidiai/NoTestProjects.patch - ) + FetchContent_Declare(kleidiai URL ${DEP_URL_kleidiai} URL_HASH SHA1=${DEP_SHA1_kleidiai}) onnxruntime_fetchcontent_makeavailable(kleidiai) set(KLEIDIAI_SOURCE_DIR ${kleidiai_SOURCE_DIR}) endif() - FetchContent_Declare(googlexnnpack URL ${DEP_URL_googlexnnpack} URL_HASH SHA1=${DEP_SHA1_googlexnnpack} PATCH_COMMAND ${Patch_EXECUTABLE} --binary --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/xnnpack/AddEmscriptenAndIosSupport.patch ) diff --git a/cmake/patches/kleidiai/NoTestProjects.patch b/cmake/patches/kleidiai/NoTestProjects.patch deleted file mode 100644 index c5b84c26fee28..0000000000000 --- a/cmake/patches/kleidiai/NoTestProjects.patch +++ /dev/null @@ -1,66 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3e78307..91bd676 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -150,61 +150,6 @@ target_compile_options(kleidiai - PRIVATE ${KLEIDIAI_WARNING_FLAGS} - ) - --if(KLEIDIAI_BUILD_TESTS) -- enable_testing() -- include(GoogleTest) -- -- add_library(kleidiai_test_framework -- test/common/data_type.cpp -- test/common/data_format.cpp -- test/common/printer.cpp -- test/common/int4.cpp -- test/common/compare.cpp -- test/common/matrix_portion.cpp -- test/common/rect.cpp -- test/common/round.cpp -- test/common/bfloat16.cpp -- test/common/float16.cpp -- test/common/cpu_info.cpp -- test/common/sme.cpp -- -- test/reference/binary_elementwise.cpp -- test/reference/matmul.cpp -- test/reference/fill.cpp -- test/reference/pack.cpp -- test/reference/quantize.cpp -- test/reference/reduce.cpp -- test/reference/transpose.cpp -- test/reference/cast.cpp -- ) -- -- target_compile_options(kleidiai_test_framework -- PUBLIC ${KLEIDIAI_WARNING_FLAGS} -- PUBLIC -march=armv8.2-a+fp16+bf16 -- ) -- -- set_source_files_properties(test/common/sme.cpp PROPERTIES COMPILE_OPTIONS -march=armv8.2-a+sve) -- -- target_link_libraries(kleidiai_test_framework -- PUBLIC kleidiai -- ) -- -- add_executable(kleidiai_test -- test/tests/matmul_test.cpp -- test/tests/matmul_clamp_f32_qai8dxp_qsi4cxp_test.cpp -- test/tests/matmul_clamp_f32_qsi8d32p_qsi4c32p_test.cpp -- ) -- -- target_link_libraries(kleidiai_test -- PRIVATE kleidiai_test_framework -- PRIVATE GTest::gtest_main -- ) -- -- # Cross-compiling is a common use case which creates a conflict if DISCOVERY_MODE is set to POST_BUILD (by default) -- # since the host platform does not match the target. Setting the mode to PRE_TEST avoids this conflict. -- gtest_discover_tests(kleidiai_test DISCOVERY_MODE PRE_TEST) --endif() -- - if(KLEIDIAI_BUILD_BENCHMARK) - # https://github.com/google/benchmark/issues/351 - if(NOT (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ARM"))