Skip to content

Commit

Permalink
[oneDPL][ranges][tests] a fixes for std::ranges::<algo> usage for win…
Browse files Browse the repository at this point in the history
…dows standard C++ library
  • Loading branch information
MikeDvorskiy committed Nov 7, 2024
1 parent b2fcd88 commit bd10e88
Show file tree
Hide file tree
Showing 17 changed files with 103 additions and 82 deletions.
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_adjacent_find.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::adjacent_find, std::ranges::adjacent_find, binary_pred);
test_range_algo<1>{}(dpl_ranges::adjacent_find, std::ranges::adjacent_find, binary_pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::adjacent_find, std::ranges::adjacent_find, binary_pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::adjacent_find, std::ranges::adjacent_find, binary_pred, &P2::proj);
auto adj_find_checker = _ONEDPL_ALGO(std::ranges::adjacent_find);

test_range_algo<0>{big_sz}(dpl_ranges::adjacent_find, adj_find_checker, binary_pred);
test_range_algo<1>{}(dpl_ranges::adjacent_find, adj_find_checker, binary_pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::adjacent_find, adj_find_checker, binary_pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::adjacent_find, adj_find_checker, binary_pred, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_all_of.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::all_of, std::ranges::all_of, pred1);
test_range_algo<1>{}(dpl_ranges::all_of, std::ranges::all_of, pred1, proj);
test_range_algo<2, P2>{}(dpl_ranges::all_of, std::ranges::all_of, pred1, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::all_of, std::ranges::all_of, pred1, &P2::proj);
auto all_of_checker = _ONEDPL_ALGO(std::ranges::all_of);

test_range_algo<0>{big_sz}(dpl_ranges::all_of, all_of_checker, pred1);
test_range_algo<1>{}(dpl_ranges::all_of, all_of_checker, pred1, proj);
test_range_algo<2, P2>{}(dpl_ranges::all_of, all_of_checker, pred1, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::all_of, all_of_checker, pred1, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_any_of.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::any_of, std::ranges::any_of, pred2);
test_range_algo<1>{}(dpl_ranges::any_of, std::ranges::any_of, pred2, proj);
test_range_algo<2, P2>{}(dpl_ranges::any_of, std::ranges::any_of, pred2, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::any_of, std::ranges::any_of, pred2, &P2::proj);
auto any_of_checker = _ONEDPL_ALGO(std::ranges::any_of);

test_range_algo<0>{big_sz}(dpl_ranges::any_of, any_of_checker, pred2);
test_range_algo<1>{}(dpl_ranges::any_of, any_of_checker, pred2, proj);
test_range_algo<2, P2>{}(dpl_ranges::any_of, any_of_checker, pred2, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::any_of, any_of_checker, pred2, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_count.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::count, std::ranges::count, 4);
test_range_algo<1>{}(dpl_ranges::count, std::ranges::count, 4, proj);
test_range_algo<2, P2>{}(dpl_ranges::count, std::ranges::count, 4, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::count, std::ranges::count, 4, &P2::proj);
auto count_checker = _ONEDPL_ALGO(std::ranges::count);

test_range_algo<0>{big_sz}(dpl_ranges::count, count_checker, 4);
test_range_algo<1>{}(dpl_ranges::count, count_checker, 4, proj);
test_range_algo<2, P2>{}(dpl_ranges::count, count_checker, 4, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::count, count_checker, 4, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_count_if.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::count_if, std::ranges::count_if, pred);
test_range_algo<1>{}(dpl_ranges::count_if, std::ranges::count_if, pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::count_if, std::ranges::count_if, pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::count_if, std::ranges::count_if, pred, &P2::proj);
auto count_if_checker = _ONEDPL_ALGO(std::ranges::count_if);

test_range_algo<0>{big_sz}(dpl_ranges::count_if, count_if_checker, pred);
test_range_algo<1>{}(dpl_ranges::count_if, count_if_checker, pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::count_if, count_if_checker, pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::count_if, count_if_checker, pred, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_equal.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0, int, data_in_in>{big_sz}(dpl_ranges::equal, std::ranges::equal, binary_pred);
test_range_algo<1, int, data_in_in>{}(dpl_ranges::equal, std::ranges::equal, binary_pred, proj, proj);
test_range_algo<2, P2, data_in_in>{}(dpl_ranges::equal, std::ranges::equal, binary_pred, &P2::x, &P2::x);
test_range_algo<3, P2, data_in_in>{}(dpl_ranges::equal, std::ranges::equal, binary_pred, &P2::proj, &P2::proj);
auto equal_checker = _ONEDPL_ALGO(std::ranges::equal);

test_range_algo<0, int, data_in_in>{big_sz}(dpl_ranges::equal, equal_checker, binary_pred);
test_range_algo<1, int, data_in_in>{}(dpl_ranges::equal, equal_checker, binary_pred, proj, proj);
test_range_algo<2, P2, data_in_in>{}(dpl_ranges::equal, equal_checker, binary_pred, &P2::x, &P2::x);
test_range_algo<3, P2, data_in_in>{}(dpl_ranges::equal, equal_checker, binary_pred, &P2::proj, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
12 changes: 7 additions & 5 deletions test/parallel_api/ranges/std_ranges_find.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::find, std::ranges::find, 4); //found case
test_range_algo<1>{}(dpl_ranges::find, std::ranges::find, -1); //not found case
test_range_algo<2>{}(dpl_ranges::find, std::ranges::find, 4, proj);
test_range_algo<3, P2>{}(dpl_ranges::find, std::ranges::find, 4, &P2::x);
test_range_algo<4, P2>{}(dpl_ranges::find, std::ranges::find, 4, &P2::proj);
auto find_checker = _ONEDPL_ALGO(std::ranges::find);

test_range_algo<0>{big_sz}(dpl_ranges::find, find_checker, 4); //found case
test_range_algo<1>{}(dpl_ranges::find, find_checker, -1); //not found case
test_range_algo<2>{}(dpl_ranges::find, find_checker, 4, proj);
test_range_algo<3, P2>{}(dpl_ranges::find, find_checker, 4, &P2::x);
test_range_algo<4, P2>{}(dpl_ranges::find, find_checker, 4, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_find_if.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::find_if, std::ranges::find_if, pred);
test_range_algo<1>{}(dpl_ranges::find_if, std::ranges::find_if, pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::find_if, std::ranges::find_if, pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::find_if, std::ranges::find_if, pred, &P2::proj);
auto find_if_checker = _ONEDPL_ALGO(std::ranges::find_if);

test_range_algo<0>{big_sz}(dpl_ranges::find_if, find_if_checker, pred);
test_range_algo<1>{}(dpl_ranges::find_if, find_if_checker, pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::find_if, find_if_checker, pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::find_if, find_if_checker, pred, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_find_if_not.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::find_if_not, std::ranges::find_if_not, pred1);
test_range_algo<1>{}(dpl_ranges::find_if_not, std::ranges::find_if_not, pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::find_if_not, std::ranges::find_if_not, pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::find_if_not, std::ranges::find_if_not, pred, &P2::proj);
auto find_if_not_checker = _ONEDPL_ALGO(std::ranges::find_if_not);

test_range_algo<0>{big_sz}(dpl_ranges::find_if_not, find_if_not_checker, pred1);
test_range_algo<1>{}(dpl_ranges::find_if_not, find_if_not_checker, pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::find_if_not, find_if_not_checker, pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::find_if_not, find_if_not_checker, pred, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
16 changes: 9 additions & 7 deletions test/parallel_api/ranges/std_ranges_is_sorted.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::is_sorted, std::ranges::is_sorted, std::ranges::less{});
auto is_sorted_checker = _ONEDPL_ALGO(std::ranges::is_sorted);

test_range_algo<1>{}(dpl_ranges::is_sorted, std::ranges::is_sorted, std::ranges::less{}, proj);
test_range_algo<2, P2>{}(dpl_ranges::is_sorted, std::ranges::is_sorted, std::ranges::less{}, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::is_sorted, std::ranges::is_sorted, std::ranges::less{}, &P2::proj);
test_range_algo<0>{big_sz}(dpl_ranges::is_sorted, is_sorted_checker, std::ranges::less{});

test_range_algo<4>{}(dpl_ranges::is_sorted, std::ranges::is_sorted, std::ranges::greater{}, proj);
test_range_algo<5, P2>{}(dpl_ranges::is_sorted, std::ranges::is_sorted, std::ranges::greater{}, &P2::x);
test_range_algo<6, P2>{}(dpl_ranges::is_sorted, std::ranges::is_sorted, std::ranges::greater{}, &P2::proj);
test_range_algo<1>{}(dpl_ranges::is_sorted, is_sorted_checker, std::ranges::less{}, proj);
test_range_algo<2, P2>{}(dpl_ranges::is_sorted, is_sorted_checker, std::ranges::less{}, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::is_sorted, is_sorted_checker, std::ranges::less{}, &P2::proj);

test_range_algo<4>{}(dpl_ranges::is_sorted, is_sorted_checker, std::ranges::greater{}, proj);
test_range_algo<5, P2>{}(dpl_ranges::is_sorted, is_sorted_checker, std::ranges::greater{}, &P2::x);
test_range_algo<6, P2>{}(dpl_ranges::is_sorted, is_sorted_checker, std::ranges::greater{}, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
16 changes: 9 additions & 7 deletions test/parallel_api/ranges/std_ranges_max_element.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::max_element, std::ranges::max_element, std::ranges::less{});
test_range_algo<1>{}(dpl_ranges::max_element, std::ranges::max_element, std::ranges::less{}, proj);
test_range_algo<2, P2>{}(dpl_ranges::max_element, std::ranges::max_element, std::ranges::less{}, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::max_element, std::ranges::max_element, std::ranges::less{}, &P2::proj);
auto max_element_checker = _ONEDPL_ALGO(std::ranges::max_element);

test_range_algo<4>{}(dpl_ranges::max_element, std::ranges::max_element, std::ranges::greater{}, proj);
test_range_algo<5, P2>{}(dpl_ranges::max_element, std::ranges::max_element, std::ranges::greater{}, &P2::x);
test_range_algo<6, P2>{}(dpl_ranges::max_element, std::ranges::max_element, std::ranges::greater{}, &P2::proj);
test_range_algo<0>{big_sz}(dpl_ranges::max_element, max_element_checker, std::ranges::less{});
test_range_algo<1>{}(dpl_ranges::max_element, max_element_checker, std::ranges::less{}, proj);
test_range_algo<2, P2>{}(dpl_ranges::max_element, max_element_checker, std::ranges::less{}, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::max_element, max_element_checker, std::ranges::less{}, &P2::proj);

test_range_algo<4>{}(dpl_ranges::max_element, max_element_checker, std::ranges::greater{}, proj);
test_range_algo<5, P2>{}(dpl_ranges::max_element, max_element_checker, std::ranges::greater{}, &P2::x);
test_range_algo<6, P2>{}(dpl_ranges::max_element, max_element_checker, std::ranges::greater{}, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
16 changes: 9 additions & 7 deletions test/parallel_api/ranges/std_ranges_min_element.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::min_element, std::ranges::min_element, std::ranges::less{});
auto min_element_checker = _ONEDPL_ALGO(std::ranges::min_element);

test_range_algo<1>{}(dpl_ranges::min_element, std::ranges::min_element, std::ranges::less{}, proj);
test_range_algo<2, P2>{}(dpl_ranges::min_element, std::ranges::min_element, std::ranges::less{}, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::min_element, std::ranges::min_element, std::ranges::less{}, &P2::proj);
test_range_algo<0>{big_sz}(dpl_ranges::min_element, min_element_checker, std::ranges::less{});

test_range_algo<4>{}(dpl_ranges::min_element, std::ranges::min_element, std::ranges::greater{}, proj);
test_range_algo<5, P2>{}(dpl_ranges::min_element, std::ranges::min_element, std::ranges::greater{}, &P2::x);
test_range_algo<6, P2>{}(dpl_ranges::min_element, std::ranges::min_element, std::ranges::greater{}, &P2::proj);
test_range_algo<1>{}(dpl_ranges::min_element, min_element_checker, std::ranges::less{}, proj);
test_range_algo<2, P2>{}(dpl_ranges::min_element, min_element_checker, std::ranges::less{}, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::min_element, min_element_checker, std::ranges::less{}, &P2::proj);

test_range_algo<4>{}(dpl_ranges::min_element, min_element_checker, std::ranges::greater{}, proj);
test_range_algo<5, P2>{}(dpl_ranges::min_element, min_element_checker, std::ranges::greater{}, &P2::x);
test_range_algo<6, P2>{}(dpl_ranges::min_element, min_element_checker, std::ranges::greater{}, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_none_of.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::none_of, std::ranges::none_of, pred3);
test_range_algo<1>{}(dpl_ranges::none_of, std::ranges::none_of, pred2, proj);
test_range_algo<2, P2>{}(dpl_ranges::none_of, std::ranges::none_of, pred3, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::none_of, std::ranges::none_of, pred3, &P2::proj);
auto none_of_checker = _ONEDPL_ALGO(std::ranges::none_of);

test_range_algo<0>{big_sz}(dpl_ranges::none_of, none_of_checker, pred3);
test_range_algo<1>{}(dpl_ranges::none_of, none_of_checker, pred2, proj);
test_range_algo<2, P2>{}(dpl_ranges::none_of, none_of_checker, pred3, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::none_of, none_of_checker, pred3, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_search.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0, int, data_in_in>{big_sz}(dpl_ranges::search, std::ranges::search, binary_pred);
test_range_algo<1, int, data_in_in>{}(dpl_ranges::search, std::ranges::search, binary_pred, proj, proj);
test_range_algo<2, P2, data_in_in>{}(dpl_ranges::search, std::ranges::search, binary_pred, &P2::x, &P2::x);
test_range_algo<3, P2, data_in_in>{}(dpl_ranges::search, std::ranges::search, binary_pred, &P2::proj, &P2::proj);
auto search_checker = _ONEDPL_ALGO(std::ranges::search);

test_range_algo<0, int, data_in_in>{big_sz}(dpl_ranges::search, search_checker, binary_pred);
test_range_algo<1, int, data_in_in>{}(dpl_ranges::search, search_checker, binary_pred, proj, proj);
test_range_algo<2, P2, data_in_in>{}(dpl_ranges::search, search_checker, binary_pred, &P2::x, &P2::x);
test_range_algo<3, P2, data_in_in>{}(dpl_ranges::search, search_checker, binary_pred, &P2::proj, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
10 changes: 6 additions & 4 deletions test/parallel_api/ranges/std_ranges_search_n.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

test_range_algo<0>{big_sz}(dpl_ranges::search_n, std::ranges::search_n, 1, 5, binary_pred);
test_range_algo<1>{}(dpl_ranges::search_n, std::ranges::search_n, 3, 5, binary_pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::search_n, std::ranges::search_n, 1, 2, binary_pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::search_n, std::ranges::search_n, 3, 5, binary_pred, &P2::proj);
auto search_n_checker = _ONEDPL_ALGO(std::ranges::search_n);

test_range_algo<0>{big_sz}(dpl_ranges::search_n, search_n_checker, 1, 5, binary_pred);
test_range_algo<1>{}(dpl_ranges::search_n, search_n_checker, 3, 5, binary_pred, proj);
test_range_algo<2, P2>{}(dpl_ranges::search_n, search_n_checker, 1, 2, binary_pred, &P2::x);
test_range_algo<3, P2>{}(dpl_ranges::search_n, search_n_checker, 3, 5, binary_pred, &P2::proj);
#endif //_ENABLE_STD_RANGES_TESTING

return TestUtils::done(_ENABLE_STD_RANGES_TESTING);
Expand Down
8 changes: 2 additions & 6 deletions test/parallel_api/ranges/std_ranges_sort.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ main()
#if _ENABLE_STD_RANGES_TESTING
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;
auto sort_checker =
#if _ONEDPL_STD_RANGES_ALGO_CPP_FUN
[](auto&&... __args) { return std::ranges::sort(std::forward<decltype(__args)>(__args)...); };
#else
std::ranges::sort;
#endif

auto sort_checker = _ONEDPL_ALGO(std::ranges::sort);

test_range_algo<0>{big_sz}(dpl_ranges::sort, sort_checker);
test_range_algo<1>{}(dpl_ranges::sort, sort_checker, std::ranges::less{});
Expand Down
7 changes: 1 addition & 6 deletions test/parallel_api/ranges/std_ranges_stable_sort.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto sort_stable_checker =
#if _ONEDPL_STD_RANGES_ALGO_CPP_FUN
[](auto&&... __args) { return std::ranges::stable_sort(std::forward<decltype(__args)>(__args)...); };
#else
std::ranges::stable_sort;
#endif
auto sort_stable_checker = _ONEDPL_ALGO(std::ranges::stable_sort);

test_range_algo<0>{big_sz}(dpl_ranges::stable_sort, sort_stable_checker);
test_range_algo<1>{}(dpl_ranges::stable_sort, sort_stable_checker, std::ranges::less{});
Expand Down

0 comments on commit bd10e88

Please sign in to comment.