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

Fix timeouts in std_ranges tests #2012

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we are reducing the test coverage here, because some parallel patterns have code differentiation by data sizes, for example __parallel_merge...
I would suggest discussing it offline on one of the next technical meeting.

#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
Loading