Skip to content

Commit

Permalink
Merge pull request #258 from eseiler/misc/avx
Browse files Browse the repository at this point in the history
[INFRA] Use SDE to emulate AVX512 in tests
  • Loading branch information
eseiler authored Dec 13, 2024
2 parents 2b04b6b + e80601b commit 06aaab3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
13 changes: 5 additions & 8 deletions test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ include (diagnostics/list_missing_unit_tests)
include (diagnostics/list_unused_unit_tests)
include (include_dependencies/add_include_dependencies)

option (HIBF_VERBOSE_TESTS "Run each test case individually" OFF)
option (HIBF_USE_INCLUDE_DEPENDENCIES
"Build tests in an hierarchical order (by an include graph, i.e. tests with less dependencies are build first)"
OFF)

macro (hibf_test unit_test_cpp)
cmake_parse_arguments (HIBF_TEST "" "" "CYCLIC_DEPENDING_INCLUDES" ${ARGN})
cmake_parse_arguments (HIBF_TEST "" "SDE" "CYCLIC_DEPENDING_INCLUDES" ${ARGN})

file (RELATIVE_PATH unit_test "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_LIST_DIR}/${unit_test_cpp}")
hibf_test_component (target "${unit_test}" TARGET_NAME)
Expand All @@ -28,12 +27,10 @@ macro (hibf_test unit_test_cpp)
target_link_libraries (${target} hibf::test::unit)
add_include_dependencies (${target} "${HIBF_TEST_CYCLIC_DEPENDING_INCLUDES}")
collect_used_test (${target})
if (HIBF_VERBOSE_TESTS)
gtest_discover_tests (
${target}
TEST_PREFIX "${test_name}::"
PROPERTIES
TIMEOUT "30")

if (HIBF_TEST_SDE)
set (TARGET_WITH_SDE "${HIBF_TEST_SDE}" "-cnl" "--" "./${target}")
add_test (NAME "${test_name}_sde" COMMAND ${TARGET_WITH_SDE})
else ()
add_test (NAME "${test_name}" COMMAND ${target})
endif ()
Expand Down
17 changes: 15 additions & 2 deletions test/unit/hibf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,24 @@ add_subdirectories ()
hibf_test (bit_vector_test.cpp)
hibf_test (config_test.cpp)
hibf_test (counting_vector_test.cpp)
hibf_test (counting_vector_avx512_test.cpp)
hibf_test (hierarchical_interleaved_bloom_filter_test.cpp)
hibf_test (insert_iterator_test.cpp)
hibf_test (interleaved_bloom_filter_test.cpp)
hibf_test (interleaved_bloom_filter_avx512_test.cpp)
hibf_test (path_test.cpp)
hibf_test (print_test.cpp)
hibf_test (timer_test.cpp)

# If available, use Intel's Software Development Emulator (SDE) to emulate AVX-512 instructions.
# See https://www.intel.com/content/www/us/en/developer/articles/tool/software-development-emulator.html
find_program (SDE64_BIN sde64)

if (SDE64_BIN)
hibf_test (counting_vector_avx512_test.cpp SDE "${SDE64_BIN}")
target_compile_options (counting_vector_avx512_test PRIVATE -mavx512bw -mavx512f)

hibf_test (interleaved_bloom_filter_avx512_test.cpp SDE "${SDE64_BIN}")
target_compile_options (interleaved_bloom_filter_avx512_test PRIVATE -mavx512bw -mavx512f)
else ()
hibf_test (counting_vector_avx512_test.cpp)
hibf_test (interleaved_bloom_filter_avx512_test.cpp)
endif ()

0 comments on commit 06aaab3

Please sign in to comment.