From 5a9bcaf44712743d7eb7fca175b7a9084a0e7fda Mon Sep 17 00:00:00 2001 From: MikeDvorskiy Date: Fri, 15 Nov 2024 14:57:22 +0100 Subject: [PATCH] [oneDPL][ranges] + TEST_PREPARE_CALLABLE wrapper --- test/parallel_api/ranges/std_ranges_adjacent_find.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_all_of.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_any_of.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_count.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_count_if.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_equal.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_find.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_find_if.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_find_if_not.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_is_sorted.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_max_element.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_min_element.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_none_of.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_search.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_search_n.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_sort.pass.cpp | 2 +- test/parallel_api/ranges/std_ranges_stable_sort.pass.cpp | 2 +- test/support/test_macros.h | 3 +++ 18 files changed, 20 insertions(+), 17 deletions(-) diff --git a/test/parallel_api/ranges/std_ranges_adjacent_find.pass.cpp b/test/parallel_api/ranges/std_ranges_adjacent_find.pass.cpp index 2558ea3b5ae..90b61d93a26 100644 --- a/test/parallel_api/ranges/std_ranges_adjacent_find.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_adjacent_find.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_all_of.pass.cpp b/test/parallel_api/ranges/std_ranges_all_of.pass.cpp index 6cdf2effd0b..73a1385dc61 100644 --- a/test/parallel_api/ranges/std_ranges_all_of.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_all_of.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_any_of.pass.cpp b/test/parallel_api/ranges/std_ranges_any_of.pass.cpp index c784ee6f146..60938f1afec 100644 --- a/test/parallel_api/ranges/std_ranges_any_of.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_any_of.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_count.pass.cpp b/test/parallel_api/ranges/std_ranges_count.pass.cpp index f89d41386e9..9a5d43ab640 100644 --- a/test/parallel_api/ranges/std_ranges_count.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_count.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_count_if.pass.cpp b/test/parallel_api/ranges/std_ranges_count_if.pass.cpp index 0fe7b22aaba..a17857a5428 100644 --- a/test/parallel_api/ranges/std_ranges_count_if.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_count_if.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_equal.pass.cpp b/test/parallel_api/ranges/std_ranges_equal.pass.cpp index a12e16f376a..9d2fde0a41f 100644 --- a/test/parallel_api/ranges/std_ranges_equal.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_equal.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_find.pass.cpp b/test/parallel_api/ranges/std_ranges_find.pass.cpp index 12558893b22..fae7c473270 100644 --- a/test/parallel_api/ranges/std_ranges_find.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_find.pass.cpp @@ -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 diff --git a/test/parallel_api/ranges/std_ranges_find_if.pass.cpp b/test/parallel_api/ranges/std_ranges_find_if.pass.cpp index 0b6cec7afbe..aa35035fa05 100644 --- a/test/parallel_api/ranges/std_ranges_find_if.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_find_if.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_find_if_not.pass.cpp b/test/parallel_api/ranges/std_ranges_find_if_not.pass.cpp index 7a1693f82d1..244dac27b20 100644 --- a/test/parallel_api/ranges/std_ranges_find_if_not.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_find_if_not.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_is_sorted.pass.cpp b/test/parallel_api/ranges/std_ranges_is_sorted.pass.cpp index 32f3008f077..689ea8e96b3 100644 --- a/test/parallel_api/ranges/std_ranges_is_sorted.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_is_sorted.pass.cpp @@ -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{}); diff --git a/test/parallel_api/ranges/std_ranges_max_element.pass.cpp b/test/parallel_api/ranges/std_ranges_max_element.pass.cpp index 53ef2d97e3a..73e46f66c70 100644 --- a/test/parallel_api/ranges/std_ranges_max_element.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_max_element.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_min_element.pass.cpp b/test/parallel_api/ranges/std_ranges_min_element.pass.cpp index e03dab9676b..eae95906c69 100644 --- a/test/parallel_api/ranges/std_ranges_min_element.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_min_element.pass.cpp @@ -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{}); diff --git a/test/parallel_api/ranges/std_ranges_none_of.pass.cpp b/test/parallel_api/ranges/std_ranges_none_of.pass.cpp index 592b75eda8d..5bd3be05127 100644 --- a/test/parallel_api/ranges/std_ranges_none_of.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_none_of.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_search.pass.cpp b/test/parallel_api/ranges/std_ranges_search.pass.cpp index f68f108a8a5..e086438dda3 100644 --- a/test/parallel_api/ranges/std_ranges_search.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_search.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_search_n.pass.cpp b/test/parallel_api/ranges/std_ranges_search_n.pass.cpp index e34d632309b..75aa27f4fc0 100644 --- a/test/parallel_api/ranges/std_ranges_search_n.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_search_n.pass.cpp @@ -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); diff --git a/test/parallel_api/ranges/std_ranges_sort.pass.cpp b/test/parallel_api/ranges/std_ranges_sort.pass.cpp index 8ab060b9d90..421016224bf 100644 --- a/test/parallel_api/ranges/std_ranges_sort.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_sort.pass.cpp @@ -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{}); diff --git a/test/parallel_api/ranges/std_ranges_stable_sort.pass.cpp b/test/parallel_api/ranges/std_ranges_stable_sort.pass.cpp index b49dfd72494..012376ae519 100644 --- a/test/parallel_api/ranges/std_ranges_stable_sort.pass.cpp +++ b/test/parallel_api/ranges/std_ranges_stable_sort.pass.cpp @@ -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{}); diff --git a/test/support/test_macros.h b/test/support/test_macros.h index 7ee8d5964d4..88ed4adf38f 100644 --- a/test/support/test_macros.h +++ b/test/support/test_macros.h @@ -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(__args)...); } + #endif // _SUPPORT_TEST_MACROS_H