Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[INFRA] Use SDE to emulate AVX512 in tests #258

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ()
Loading