diff --git a/CMakeLists.txt b/CMakeLists.txt index 9742ae33a3f..3cb28a1693d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,7 @@ endif() ############################################################################### add_library(oneDPL INTERFACE) target_compile_features(oneDPL INTERFACE cxx_std_17) +target_compile_definitions(oneDPL INTERFACE $<$:PSTL_USE_DEBUG=1>) if (CMAKE_BUILD_TYPE) message(STATUS "Build type is ${CMAKE_BUILD_TYPE}") @@ -180,7 +181,6 @@ if (ONEDPL_BACKEND MATCHES "^(tbb|dpcpp|dpcpp_only)$") target_compile_definitions(oneDPL INTERFACE $<$:TBB_USE_DEBUG=1> - $<$:PSTL_USE_DEBUG> $<$:ONEDPL_USE_TBB_BACKEND=0> $<$:ONEDPL_USE_DPCPP_BACKEND=0> ) diff --git a/test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp b/test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp index d3777c536e5..113c24be7c8 100644 --- a/test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp +++ b/test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp @@ -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(n, [](size_t k) { return k % 5 != 1 ? In1(3 * k + 7) : 0; }); Sequence in2(n, [](size_t k) { return k % 7 != 2 ? In2(5 * k + 5) : 0; });