Skip to content

Commit

Permalink
[oneDPL][ranges] _ONEDPL_ALGO -> _ONEDPL_PREPARE_CALLABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDvorskiy committed Nov 8, 2024
1 parent bd10e88 commit 545cd75
Show file tree
Hide file tree
Showing 19 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions include/oneapi/dpl/pstl/glue_algorithm_ranges_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/oneapi/dpl/pstl/onedpl_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<decltype(__args)>(__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
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_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);
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_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);
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_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);
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_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);
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_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);
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_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);
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_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
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_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);
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_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);
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_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{});

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_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);
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_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{});

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_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);
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_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);
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_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);
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_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{});
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_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{});
Expand Down

0 comments on commit 545cd75

Please sign in to comment.