Skip to content

Commit

Permalink
[oneDPL][ranges] + TEST_PREPARE_CALLABLE wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDvorskiy committed Nov 15, 2024
1 parent b850deb commit 5a9bcaf
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_adjacent_find.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto adj_find_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::adjacent_find);
auto adj_find_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_all_of.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto all_of_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::all_of);
auto all_of_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_any_of.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto any_of_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::any_of);
auto any_of_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_count.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto count_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::count);
auto count_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_count_if.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto count_if_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::count_if);
auto count_if_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_equal.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto equal_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::equal);
auto equal_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_find.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto find_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::find);
auto find_checker = TEST_PREPARE_CALLABLE(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
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_find_if.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto find_if_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::find_if);
auto find_if_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_find_if_not.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto find_if_not_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::find_if_not);
auto find_if_not_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_is_sorted.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto is_sorted_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::is_sorted);
auto is_sorted_checker = TEST_PREPARE_CALLABLE(std::ranges::is_sorted);

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

Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_max_element.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto max_element_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::max_element);
auto max_element_checker = TEST_PREPARE_CALLABLE(std::ranges::max_element);

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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_min_element.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto min_element_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::min_element);
auto min_element_checker = TEST_PREPARE_CALLABLE(std::ranges::min_element);

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

Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_none_of.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto none_of_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::none_of);
auto none_of_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_search.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto search_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::search);
auto search_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_search_n.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto search_n_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::search_n);
auto search_n_checker = TEST_PREPARE_CALLABLE(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);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_sort.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto sort_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::sort);
auto sort_checker = TEST_PREPARE_CALLABLE(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
2 changes: 1 addition & 1 deletion test/parallel_api/ranges/std_ranges_stable_sort.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main()
using namespace test_std_ranges;
namespace dpl_ranges = oneapi::dpl::ranges;

auto sort_stable_checker = _ONEDPL_PREPARE_CALLABLE(std::ranges::stable_sort);
auto sort_stable_checker = TEST_PREPARE_CALLABLE(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
3 changes: 3 additions & 0 deletions test/support/test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,4 +377,7 @@ inline void DoNotOptimize(Tp const& value) {
#define TEST_NO_UNIQUE_ADDRESS
#endif

#define TEST_PREPARE_CALLABLE(std_algo_name) \
[](auto&&... __args) { return std_algo_name(std::forward<decltype(__args)>(__args)...); }

#endif // _SUPPORT_TEST_MACROS_H

0 comments on commit 5a9bcaf

Please sign in to comment.