Skip to content

Commit

Permalink
[test] Reduce test input sizes for debug builds with OpenMP in `trans…
Browse files Browse the repository at this point in the history
…form_binary.pass` (#1921)

Signed-off-by: Matthew Michel <[email protected]>
  • Loading branch information
mmichel11 authored Nov 1, 2024
1 parent ac39d7e commit c376768
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ endif()
###############################################################################
add_library(oneDPL INTERFACE)
target_compile_features(oneDPL INTERFACE cxx_std_17)
target_compile_definitions(oneDPL INTERFACE $<$<CONFIG:Debug>:PSTL_USE_DEBUG=1>)

if (CMAKE_BUILD_TYPE)
message(STATUS "Build type is ${CMAKE_BUILD_TYPE}")
Expand Down Expand Up @@ -180,7 +181,6 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$")

target_compile_definitions(oneDPL INTERFACE
$<$<CONFIG:Debug>:TBB_USE_DEBUG=1>
$<$<CONFIG:Debug>:PSTL_USE_DEBUG>
$<$<BOOL:${SET_BACKEND_DPCPP_ONLY}>:ONEDPL_USE_TBB_BACKEND=0>
$<$<BOOL:${SET_BACKEND_TBB}>:ONEDPL_USE_DPCPP_BACKEND=0>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,15 @@ template <::std::size_t CallNumber, typename In1, typename In2, typename Out, ty
void
test(Predicate pred, _IteratorAdapter adap = {})
{
for (size_t n = 0; n <= 100000; n = n <= 16 ? n + 1 : size_t(3.1415 * n))
// Testing is restricted for debug build + OpenMP backend as without optimization the compiler generates
// very slow code leading to test timeouts.
size_t max_n =
#if PSTL_USE_DEBUG && ONEDPL_USE_OPENMP_BACKEND
10000;
#else
100000;
#endif
for (size_t n = 0; n <= max_n; n = n <= 16 ? n + 1 : size_t(3.1415 * n))
{
Sequence<In1> in1(n, [](size_t k) { return k % 5 != 1 ? In1(3 * k + 7) : 0; });
Sequence<In2> in2(n, [](size_t k) { return k % 7 != 2 ? In2(5 * k + 5) : 0; });
Expand Down

0 comments on commit c376768

Please sign in to comment.