From 545cd75c08dd72128cbece4890c40b12c567ac01 Mon Sep 17 00:00:00 2001 From: MikeDvorskiy Date: Fri, 8 Nov 2024 14:47:36 +0100 Subject: [PATCH] [oneDPL][ranges] _ONEDPL_ALGO -> _ONEDPL_PREPARE_CALLABLE --- include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h | 4 ++-- include/oneapi/dpl/pstl/onedpl_config.h | 4 ++-- 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 +- 19 files changed, 21 insertions(+), 21 deletions(-) diff --git a/include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h b/include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h index 50dda766267..3831f0ac96a 100644 --- a/include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h +++ b/include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h @@ -426,7 +426,7 @@ struct __stable_sort_fn const auto __dispatch_tag = oneapi::dpl::__ranges::__select_backend(__exec); return oneapi::dpl::__internal::__ranges::__pattern_sort_ranges(__dispatch_tag, std::forward<_ExecutionPolicy>(__exec), std::forward<_R>(__r), __comp, __proj, - _ONEDPL_ALGO(std::ranges::stable_sort) + _ONEDPL_PREPARE_CALLABLE(std::ranges::stable_sort) ); } }; //__stable_sort_fn @@ -448,7 +448,7 @@ struct __sort_fn const auto __dispatch_tag = oneapi::dpl::__ranges::__select_backend(__exec); return oneapi::dpl::__internal::__ranges::__pattern_sort_ranges(__dispatch_tag, std::forward<_ExecutionPolicy>(__exec), std::forward<_R>(__r), __comp, __proj, - _ONEDPL_ALGO(std::ranges::sort) + _ONEDPL_PREPARE_CALLABLE(std::ranges::sort) ); } }; //__sort_fn diff --git a/include/oneapi/dpl/pstl/onedpl_config.h b/include/oneapi/dpl/pstl/onedpl_config.h index b2f5c6586ef..4a17bf98b75 100644 --- a/include/oneapi/dpl/pstl/onedpl_config.h +++ b/include/oneapi/dpl/pstl/onedpl_config.h @@ -334,10 +334,10 @@ #endif #if _ONEDPL_STD_RANGES_ALGO_CPP_FUN -# define _ONEDPL_ALGO(std_algo_name) \ +# define _ONEDPL_PREPARE_CALLABLE(std_algo_name) \ [](auto&&... __args) { return std_algo_name(std::forward(__args)...); } #else -# define _ONEDPL_ALGO(std_algo_name) std_algo_name +# define _ONEDPL_PREPARE_CALLABLE(std_algo_name) std_algo_name #endif #endif // _ONEDPL_CONFIG_H 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 432f2616b40..2558ea3b5ae 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_ALGO(std::ranges::adjacent_find); + auto adj_find_checker = _ONEDPL_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 23d577f70b5..6cdf2effd0b 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_ALGO(std::ranges::all_of); + auto all_of_checker = _ONEDPL_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 a0aea9653f3..c784ee6f146 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_ALGO(std::ranges::any_of); + auto any_of_checker = _ONEDPL_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 87ad55e02e7..f89d41386e9 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_ALGO(std::ranges::count); + auto count_checker = _ONEDPL_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 5fa56b45122..0fe7b22aaba 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_ALGO(std::ranges::count_if); + auto count_if_checker = _ONEDPL_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 32e62e54216..a12e16f376a 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_ALGO(std::ranges::equal); + auto equal_checker = _ONEDPL_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 a48927d8087..12558893b22 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_ALGO(std::ranges::find); + auto find_checker = _ONEDPL_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 2d7b2b59f31..0b6cec7afbe 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_ALGO(std::ranges::find_if); + auto find_if_checker = _ONEDPL_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 dccb389f263..7a1693f82d1 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_ALGO(std::ranges::find_if_not); + auto find_if_not_checker = _ONEDPL_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 238e6addfab..32f3008f077 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_ALGO(std::ranges::is_sorted); + auto is_sorted_checker = _ONEDPL_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 13db0fa612f..53ef2d97e3a 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_ALGO(std::ranges::max_element); + auto max_element_checker = _ONEDPL_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 77c81667eac..e03dab9676b 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_ALGO(std::ranges::min_element); + auto min_element_checker = _ONEDPL_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 51db5402657..592b75eda8d 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_ALGO(std::ranges::none_of); + auto none_of_checker = _ONEDPL_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 69a1d8e8ca9..f68f108a8a5 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_ALGO(std::ranges::search); + auto search_checker = _ONEDPL_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 0d3d0d094ba..e34d632309b 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_ALGO(std::ranges::search_n); + auto search_n_checker = _ONEDPL_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 ef3ddf6ce8f..8ab060b9d90 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_ALGO(std::ranges::sort); + auto sort_checker = _ONEDPL_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 5d490f2d1a3..b49dfd72494 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_ALGO(std::ranges::stable_sort); + auto sort_stable_checker = _ONEDPL_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{});