Skip to content

Commit

Permalink
Renames...
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Kopienko authored and SergeyKopienko committed Apr 12, 2024
1 parent 2ca57e3 commit 28c6e5b
Show file tree
Hide file tree
Showing 13 changed files with 167 additions and 162 deletions.
18 changes: 10 additions & 8 deletions include/oneapi/dpl/internal/async_extension_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,26 +76,28 @@ auto
transform_async(_ExecutionPolicy&& __exec, _ForwardIt1 first1, _ForwardIt1 last1, _ForwardIt2 first2,
_ForwardIt3 d_first, _BinaryOperation binary_op, _Events&&... __dependencies);

template <class _ExecutionPolicy, class _ForwardIt1, class _ForwardIt2, class _T, class _BinaryOp1, class _BinaryOp2,
class... _Events,
template <class _ExecutionPolicy, class _ForwardIt1, class _ForwardIt2, class _T, class _BinaryReduceOp,
class _BinaryTransformOp, class... _Events,
oneapi::dpl::__internal::__enable_if_device_execution_policy_double_no_default<
_ExecutionPolicy, int, _BinaryOp1, _BinaryOp2, _Events...> = 0>
_ExecutionPolicy, int, _BinaryReduceOp, _BinaryTransformOp, _Events...> = 0>
auto
transform_reduce_async(_ExecutionPolicy&& __exec, _ForwardIt1 __first1, _ForwardIt1 __last1, _ForwardIt2 __first2,
_T __init, _BinaryOp1 __binary_op1, _BinaryOp2 __binary_op2, _Events&&... __dependencies);
_T __init, _BinaryReduceOp __reduce_op, _BinaryTransformOp __transform_op,
_Events&&... __dependencies);

template <class _ExecutionPolicy, class _ForwardIt1, class _ForwardIt2, class _T, class... _Events,
oneapi::dpl::__internal::__enable_if_device_execution_policy<_ExecutionPolicy, int, _Events...> = 0>
auto
transform_reduce_async(_ExecutionPolicy&& __exec, _ForwardIt1 __first1, _ForwardIt1 __last1, _ForwardIt2 __first2,
_T __init, _Events&&... __dependencies);

template <class _ExecutionPolicy, class _ForwardIt, class _T, class _BinaryOp, class _UnaryOp, class... _Events,
oneapi::dpl::__internal::__enable_if_device_execution_policy_single_no_default<_ExecutionPolicy, int,
_UnaryOp, _Events...> = 0>
template <class _ExecutionPolicy, class _ForwardIt, class _T, class _BinaryReduceOp, class _UnaryTransformOp,
class... _Events,
oneapi::dpl::__internal::__enable_if_device_execution_policy_single_no_default<
_ExecutionPolicy, int, _UnaryTransformOp, _Events...> = 0>
auto
transform_reduce_async(_ExecutionPolicy&& __exec, _ForwardIt __first, _ForwardIt __last, _T __init,
_BinaryOp __binary_op, _UnaryOp __unary_op, _Events&&... __dependencies);
_BinaryReduceOp __reduce_op, _UnaryTransformOp __transform_op, _Events&&... __dependencies);

template <class _ExecutionPolicy, class _RandomAccessIterator, class... _Events,
oneapi::dpl::__internal::__enable_if_device_execution_policy<_ExecutionPolicy, int, _Events...> = 0>
Expand Down
18 changes: 9 additions & 9 deletions include/oneapi/dpl/internal/async_impl/async_impl_hetero.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,16 +120,16 @@ __pattern_walk2_brick_async(__hetero_tag<_BackendTag> __tag, _ExecutionPolicy&&
//------------------------------------------------------------------------

template <typename _BackendTag, typename _ExecutionPolicy, typename _RandomAccessIterator1,
typename _RandomAccessIterator2, typename _Tp, typename _BinaryOperation1, typename _BinaryOperation2>
typename _RandomAccessIterator2, typename _Tp, typename _BinaryReduceOp, typename _BinaryTransformOp>
auto
__pattern_transform_reduce_async(__hetero_tag<_BackendTag>, _ExecutionPolicy&& __exec, _RandomAccessIterator1 __first1,
_RandomAccessIterator1 __last1, _RandomAccessIterator2 __first2, _Tp __init,
_BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
_BinaryReduceOp __reduce_op, _BinaryTransformOp __transform_op)
{
assert(__first1 < __last1);

using _Policy = _ExecutionPolicy;
using _Functor = unseq_backend::walk_n<_Policy, _BinaryOperation2>;
using _Functor = unseq_backend::walk_n<_Policy, _BinaryTransformOp>;
using _RepackedTp = __par_backend_hetero::__repacked_tuple_t<_Tp>;

auto __n = __last1 - __first1;
Expand All @@ -142,7 +142,7 @@ __pattern_transform_reduce_async(__hetero_tag<_BackendTag>, _ExecutionPolicy&& _

return oneapi::dpl::__par_backend_hetero::__parallel_transform_reduce<_RepackedTp,
::std::true_type /*is_commutative*/>(
_BackendTag{}, ::std::forward<_ExecutionPolicy>(__exec), __binary_op1, _Functor{__binary_op2},
_BackendTag{}, ::std::forward<_ExecutionPolicy>(__exec), __reduce_op, _Functor{__transform_op},
unseq_backend::__init_value<_RepackedTp>{__init}, // initial value
__buf1.all_view(), __buf2.all_view());
}
Expand All @@ -152,24 +152,24 @@ __pattern_transform_reduce_async(__hetero_tag<_BackendTag>, _ExecutionPolicy&& _
//------------------------------------------------------------------------

template <typename _BackendTag, typename _ExecutionPolicy, typename _ForwardIterator, typename _Tp,
typename _BinaryOperation, typename _UnaryOperation>
typename _BinaryReduceOp, typename _UnaryTransformOp>
auto
__pattern_transform_reduce_async(__hetero_tag<_BackendTag>, _ExecutionPolicy&& __exec, _ForwardIterator __first,
_ForwardIterator __last, _Tp __init, _BinaryOperation __binary_op,
_UnaryOperation __unary_op)
_ForwardIterator __last, _Tp __init, _BinaryReduceOp __reduce_op,
_UnaryTransformOp __transform_op)
{
assert(__first < __last);

using _Policy = _ExecutionPolicy;
using _Functor = unseq_backend::walk_n<_Policy, _UnaryOperation>;
using _Functor = unseq_backend::walk_n<_Policy, _UnaryTransformOp>;
using _RepackedTp = __par_backend_hetero::__repacked_tuple_t<_Tp>;

auto __keep = oneapi::dpl::__ranges::__get_sycl_range<__par_backend_hetero::access_mode::read, _ForwardIterator>();
auto __buf = __keep(__first, __last);

return oneapi::dpl::__par_backend_hetero::__parallel_transform_reduce<_RepackedTp,
::std::true_type /*is_commutative*/>(
_BackendTag{}, ::std::forward<_ExecutionPolicy>(__exec), __binary_op, _Functor{__unary_op},
_BackendTag{}, ::std::forward<_ExecutionPolicy>(__exec), __reduce_op, _Functor{__transform_op},
unseq_backend::__init_value<_RepackedTp>{__init}, // initial value
__buf.all_view());
}
Expand Down
22 changes: 12 additions & 10 deletions include/oneapi/dpl/internal/async_impl/glue_async_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,34 +187,36 @@ fill_async(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator

// [async.transform_reduce]

template <class _ExecutionPolicy, class _ForwardIt1, class _ForwardIt2, class _T, class _BinaryOp1, class _BinaryOp2,
class... _Events,
template <class _ExecutionPolicy, class _ForwardIt1, class _ForwardIt2, class _T, class _BinaryReduceOp,
class _BinaryTransformOp, class... _Events,
oneapi::dpl::__internal::__enable_if_device_execution_policy_double_no_default<
_ExecutionPolicy, int, _BinaryOp1, _BinaryOp2, _Events...>>
_ExecutionPolicy, int, _BinaryReduceOp, _BinaryTransformOp, _Events...>>
auto
transform_reduce_async(_ExecutionPolicy&& __exec, _ForwardIt1 __first1, _ForwardIt1 __last1, _ForwardIt2 __first2,
_T __init, _BinaryOp1 __binary_op1, _BinaryOp2 __binary_op2, _Events&&... __dependencies)
_T __init, _BinaryReduceOp __reduce_op, _BinaryTransformOp __transform_op,
_Events&&... __dependencies)
{
const auto __dispatch_tag = oneapi::dpl::__internal::__select_backend(__exec, __first1, __first2);

wait_for_all(::std::forward<_Events>(__dependencies)...);
return oneapi::dpl::__internal::__pattern_transform_reduce_async(
__dispatch_tag, ::std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __init, __binary_op1,
__binary_op2);
__dispatch_tag, ::std::forward<_ExecutionPolicy>(__exec), __first1, __last1, __first2, __init, __reduce_op,
__transform_op);
}

template <class _ExecutionPolicy, class _ForwardIt, class _T, class _BinaryOp, class _UnaryOp, class... _Events,
template <class _ExecutionPolicy, class _ForwardIt, class _T, class _BinaryReduceOp, class _UnaryTransformOp,
class... _Events,
oneapi::dpl::__internal::__enable_if_device_execution_policy_single_no_default<_ExecutionPolicy, int,
_UnaryOp, _Events...>>
_UnaryTransformOp, _Events...>>
auto
transform_reduce_async(_ExecutionPolicy&& __exec, _ForwardIt __first, _ForwardIt __last, _T __init,
_BinaryOp __binary_op, _UnaryOp __unary_op, _Events&&... __dependencies)
_BinaryReduceOp __reduce_op, _UnaryTransformOp __transform_op, _Events&&... __dependencies)
{
const auto __dispatch_tag = oneapi::dpl::__internal::__select_backend(__exec, __first);

wait_for_all(::std::forward<_Events>(__dependencies)...);
return oneapi::dpl::__internal::__pattern_transform_reduce_async(
__dispatch_tag, ::std::forward<_ExecutionPolicy>(__exec), __first, __last, __init, __binary_op, __unary_op);
__dispatch_tag, ::std::forward<_ExecutionPolicy>(__exec), __first, __last, __init, __reduce_op, __transform_op);
}

template <class _ExecutionPolicy, class _ForwardIt1, class _ForwardIt2, class _T, class... _Events,
Expand Down
17 changes: 7 additions & 10 deletions include/oneapi/dpl/pstl/glue_numeric_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,17 @@ reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __l

template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _Tp __init);
transform_reduce(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Tp);

template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1,
class _BinaryOperation2>
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryReduceOp,
class _BinaryTransformOp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1,
_BinaryOperation2 __binary_op2);
transform_reduce(_ExecutionPolicy&&, _ForwardIterator1, _ForwardIterator1, _ForwardIterator2, _Tp, _BinaryReduceOp,
_BinaryTransformOp);

template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryReduceOp, class _UnaryTransformOp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
_BinaryOperation __binary_op, _UnaryOperation __unary_op);
transform_reduce(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _Tp, _BinaryReduceOp, _UnaryTransformOp);

// [exclusive.scan]

Expand Down
17 changes: 9 additions & 8 deletions include/oneapi/dpl/pstl/glue_numeric_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,28 +78,29 @@ transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _Forward
::std::plus<_InputType>(), ::std::multiplies<_InputType>());
}

template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryOperation1,
class _BinaryOperation2>
template <class _ExecutionPolicy, class _ForwardIterator1, class _ForwardIterator2, class _Tp, class _BinaryReductionOp,
class _BinaryTransformOp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator1 __first1, _ForwardIterator1 __last1,
_ForwardIterator2 __first2, _Tp __init, _BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
_ForwardIterator2 __first2, _Tp __init, _BinaryReductionOp __reduce_op,
_BinaryTransformOp __transform_op)
{
const auto __dispatch_tag = oneapi::dpl::__internal::__select_backend(__exec, __first1, __first2);

return oneapi::dpl::__internal::__pattern_transform_reduce(__dispatch_tag, ::std::forward<_ExecutionPolicy>(__exec),
__first1, __last1, __first2, __init, __binary_op1,
__binary_op2);
__first1, __last1, __first2, __init, __reduce_op,
__transform_op);
}

template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryOperation, class _UnaryOperation>
template <class _ExecutionPolicy, class _ForwardIterator, class _Tp, class _BinaryReduceOp, class _UnaryTransformOp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _Tp __init,
_BinaryOperation __binary_op, _UnaryOperation __unary_op)
_BinaryReduceOp __reduce_op, _UnaryTransformOp __transform_op)
{
const auto __dispatch_tag = oneapi::dpl::__internal::__select_backend(__exec, __first);

return oneapi::dpl::__internal::__pattern_transform_reduce(__dispatch_tag, ::std::forward<_ExecutionPolicy>(__exec),
__first, __last, __init, __binary_op, __unary_op);
__first, __last, __init, __reduce_op, __transform_op);
}

// [exclusive.scan]
Expand Down
15 changes: 8 additions & 7 deletions include/oneapi/dpl/pstl/glue_numeric_ranges_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,17 @@ template <typename _ExecutionPolicy, typename _Range1, typename _Range2, typenam
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _Range1&& __rng1, _Range2&& __rng2, _Tp __init);

template <typename _ExecutionPolicy, typename _Range1, typename _Range2, typename _Tp, typename _BinaryOperation1,
typename _BinaryOperation2>
template <typename _ExecutionPolicy, typename _Range1, typename _Range2, typename _Tp, typename _BinaryReduceOp,
typename _BinaryTransformOp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _Range1&& __rng1, _Range2&& __rng2, _Tp __init,
_BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2);
transform_reduce(_ExecutionPolicy&& __exec, _Range1&& __rng1, _Range2&& __rng2, _Tp __init, _BinaryReduceOp __reduce_op,
_BinaryTransformOp __transform_op);

template <typename _ExecutionPolicy, typename _Range, typename _Tp, typename _BinaryOperation, typename _UnaryOperation>
template <typename _ExecutionPolicy, typename _Range, typename _Tp, typename _BinaryReduceOp,
typename _UnaryTransformOp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _Range&& __rng, _Tp __init, _BinaryOperation __binary_op,
_UnaryOperation __unary_op);
transform_reduce(_ExecutionPolicy&& __exec, _Range&& __rng, _Tp __init, _BinaryReduceOp __reduce_op,
_UnaryTransformOp __transform_op);

// [exclusive.scan]

Expand Down
19 changes: 10 additions & 9 deletions include/oneapi/dpl/pstl/glue_numeric_ranges_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,29 +72,30 @@ transform_reduce(_ExecutionPolicy&& __exec, _Range1&& __rng1, _Range2&& __rng2,
::std::multiplies<_ValueType>());
}

template <typename _ExecutionPolicy, typename _Range1, typename _Range2, typename _Tp, typename _BinaryOperation1,
typename _BinaryOperation2>
template <typename _ExecutionPolicy, typename _Range1, typename _Range2, typename _Tp, typename _BinaryReduceOp,
typename _BinaryTransformOp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _Range1&& __rng1, _Range2&& __rng2, _Tp __init,
_BinaryOperation1 __binary_op1, _BinaryOperation2 __binary_op2)
transform_reduce(_ExecutionPolicy&& __exec, _Range1&& __rng1, _Range2&& __rng2, _Tp __init, _BinaryReduceOp __reduce_op,
_BinaryTransformOp __transform_op)
{
const auto __dispatch_tag = oneapi::dpl::__ranges::__select_backend(__exec, __rng1, __rng2);

return oneapi::dpl::__internal::__ranges::__pattern_transform_reduce(
__dispatch_tag, ::std::forward<_ExecutionPolicy>(__exec), views::all_read(::std::forward<_Range1>(__rng1)),
views::all_read(::std::forward<_Range2>(__rng2)), __init, __binary_op1, __binary_op2);
views::all_read(::std::forward<_Range2>(__rng2)), __init, __reduce_op, __transform_op);
}

template <typename _ExecutionPolicy, typename _Range, typename _Tp, typename _BinaryOperation, typename _UnaryOperation>
template <typename _ExecutionPolicy, typename _Range, typename _Tp, typename _BinaryReduceOp,
typename _UnaryTransformOp>
oneapi::dpl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _Tp>
transform_reduce(_ExecutionPolicy&& __exec, _Range&& __rng, _Tp __init, _BinaryOperation __binary_op,
_UnaryOperation __unary_op)
transform_reduce(_ExecutionPolicy&& __exec, _Range&& __rng, _Tp __init, _BinaryReduceOp __reduce_op,
_UnaryTransformOp __transform_op)
{
const auto __dispatch_tag = oneapi::dpl::__ranges::__select_backend(__exec, __rng);

return oneapi::dpl::__internal::__ranges::__pattern_transform_reduce(
__dispatch_tag, ::std::forward<_ExecutionPolicy>(__exec), views::all_read(::std::forward<_Range>(__rng)),
__init, __binary_op, __unary_op);
__init, __reduce_op, __transform_op);
}

// [exclusive.scan]
Expand Down
Loading

0 comments on commit 28c6e5b

Please sign in to comment.