Skip to content

Commit

Permalink
rm kleidia test program
Browse files Browse the repository at this point in the history
  • Loading branch information
Yi Zhang committed Sep 11, 2024
1 parent 2936f7c commit 1c0f420
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmake/external/xnnpack.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ 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})
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
)
onnxruntime_fetchcontent_makeavailable(kleidiai)
set(KLEIDIAI_SOURCE_DIR ${kleidiai_SOURCE_DIR})
endif()
Expand Down
66 changes: 66 additions & 0 deletions cmake/patches/kleidiai/NoTestProjects.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
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"))

0 comments on commit 1c0f420

Please sign in to comment.