Skip to content

Commit 1700186

Browse files
Automatic testing of avx512 hierarchy based on arch description
1 parent 9e79d6a commit 1700186

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ if (XSIMD_ENABLE_WERROR)
208208
endif()
209209

210210
add_subdirectory(doc)
211+
add_subdirectory(architectures)
211212

212213
if(EMSCRIPTEN)
213214
set_target_properties(test_xsimd PROPERTIES LINK_FLAGS "-s MODULARIZE=1 -s EXPORT_NAME=test_xsimd_wasm -s WASM=1 -s ALLOW_MEMORY_GROWTH=1 -lembind")

test/architectures/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
set(INTEL_PROCESSORS
2+
knl knm skylake-avx512 cannonlake icelake-client
3+
icelake-server cascadelake cooperlake tigerlake sapphirerapids alderlake
4+
rocketlake graniterapids graniterapids-d znver4)
5+
set(CMAKE_CXX_FLAGS "")
6+
7+
foreach(INTEL_PROCESSOR ${INTEL_PROCESSORS})
8+
check_cxx_compiler_flag(-march=${INTEL_PROCESSOR} FLAG_SUPPORTED_${INTEL_PROCESSOR})
9+
if(FLAG_SUPPORTED_${INTEL_PROCESSOR})
10+
message(STATUS ${INTEL_PROCESSOR})
11+
add_library(test_${INTEL_PROCESSOR} OBJECT dummy.cpp)
12+
target_compile_options(test_${INTEL_PROCESSOR} PRIVATE -march=${INTEL_PROCESSOR})
13+
target_include_directories(test_${INTEL_PROCESSOR} PRIVATE ${XSIMD_INCLUDE_DIR})
14+
add_dependencies(xtest test_${INTEL_PROCESSOR})
15+
if(ENABLE_XTL_COMPLEX)
16+
target_compile_features(test_${INTEL_PROCESSOR} PRIVATE cxx_std_14)
17+
target_compile_definitions(test_${INTEL_PROCESSOR} PRIVATE XSIMD_ENABLE_XTL_COMPLEX=1)
18+
target_link_libraries(test_${INTEL_PROCESSOR} PRIVATE xtl)
19+
endif()
20+
endif()
21+
endforeach()
22+

test/architectures/dummy.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include <xsimd/xsimd.hpp>
2+
3+
// Basic check: can we instantiate a batch for the given compiler flags?
4+
xsimd::batch<int> come_and_get_some(xsimd::batch<int> x, xsimd::batch<int> y)
5+
{
6+
return x + y;
7+
}

0 commit comments

Comments
 (0)