Skip to content

Commit

Permalink
Fix timeouts in std_ranges tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitriy-sobolev committed Jan 20, 2025
1 parent 2e31d5c commit 9a63392
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions test/parallel_api/ranges/std_ranges_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ static_assert(ONEDPL_HAS_RANGE_ALGORITHMS >= 202409L);
namespace test_std_ranges
{

inline constexpr std::size_t big_sz = (1<<25) + 10; //32M
inline constexpr std::size_t big_sz =
#if PSTL_USE_DEBUG
(1<<18) + 10; //256K
#else
(1<<25) + 10; //32M
#endif

#if TEST_DPCPP_BACKEND_PRESENT
template<int call_id = 0>
Expand Down Expand Up @@ -176,7 +181,7 @@ struct test
static_assert(std::is_same_v<decltype(res), decltype(checker(r_in, args...))>, "Wrong return type");

auto bres = ret_in_val(expected_res, expected_view.begin()) == ret_in_val(res, r_in.begin());
EXPECT_TRUE(bres, (std::string("wrong return value from algo with ranges: ") + typeid(Algo).name() +
EXPECT_TRUE(bres, (std::string("wrong return value from algo with ranges: ") + typeid(Algo).name() +
typeid(decltype(tr_in(std::declval<Container&>()()))).name()).c_str());

//check result
Expand Down Expand Up @@ -284,7 +289,7 @@ struct test
assert(n_in1 <= max_n);
assert(n_in2 <= max_n);
assert(n_out <= max_n_out);

auto src_view1 = tr_in(std::views::all(cont_in1()));
auto src_view2 = tr_in(std::views::all(cont_in2()));
auto expected_view = tr_out(std::views::all(cont_exp()));
Expand Down Expand Up @@ -362,7 +367,7 @@ struct test
template<typename T, typename ViewType>
struct host_subrange_impl
{
static_assert(std::is_trivially_copyable_v<T>,
static_assert(std::is_trivially_copyable_v<T>,
"Memory initialization within the class relies on trivially copyability of the type T");

using type = ViewType;
Expand Down Expand Up @@ -410,9 +415,9 @@ struct host_vector

template<typename Policy>
host_vector(Policy&&, T* data, int n): vec(data, data + n), p(data) {}

template<typename Policy, typename DataGen>
host_vector(Policy&&, int n, DataGen gen): vec(n)
host_vector(Policy&&, int n, DataGen gen): vec(n)
{
for(int i = 0; i < n; ++i)
vec[i] = gen(i);
Expand Down

0 comments on commit 9a63392

Please sign in to comment.