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

[test] Reduce test input sizes for debug builds with OpenMP in transform_binary.pass #1921

Merged
merged 4 commits into from
Nov 1, 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
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
Loading