Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Michel <[email protected]>
  • Loading branch information
mmichel11 committed Nov 13, 2024
1 parent 5987df9 commit d80377e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
6 changes: 2 additions & 4 deletions include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2312,8 +2312,7 @@ __parallel_reduce_by_segment_fallback(oneapi::dpl::__internal::__device_backend_
// Round 1: reduce with extra indices added to avoid long segments
// TODO: At threshold points check if the key is equal to the key at the previous threshold point, indicating a long sequence.
// Skip a round of copy_if and reduces if there are none.
auto __idx =
oneapi::dpl::__par_backend_hetero::__buffer<_ExecutionPolicy, __diff_type>(__exec, __n).get_buffer();
auto __idx = oneapi::dpl::__par_backend_hetero::__buffer<_ExecutionPolicy, __diff_type>(__exec, __n).get_buffer();
auto __tmp_out_keys =
oneapi::dpl::__par_backend_hetero::__buffer<_ExecutionPolicy, __key_type>(__exec, __n).get_buffer();
auto __tmp_out_values =
Expand Down Expand Up @@ -2359,8 +2358,7 @@ __parallel_reduce_by_segment_fallback(oneapi::dpl::__internal::__device_backend_
oneapi::dpl::__par_backend_hetero::__parallel_for(
oneapi::dpl::__internal::__device_backend_tag{},
oneapi::dpl::__par_backend_hetero::make_wrapped_policy<__reduce1_wrapper>(__exec),
unseq_backend::__brick_reduce_idx<_BinaryOperator, decltype(__n)>(__binary_op, __n),
__intermediate_result_end,
unseq_backend::__brick_reduce_idx<_BinaryOperator, decltype(__n)>(__binary_op, __n), __intermediate_result_end,
oneapi::dpl::__ranges::take_view_simple(oneapi::dpl::__ranges::views::all_read(__idx),
__intermediate_result_end),
std::forward<_Range2>(__values), oneapi::dpl::__ranges::views::all_write(__tmp_out_values))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@ template <typename... _Name>
using _SegReducePrefixPhase = __seg_reduce_prefix_kernel<_Name...>;
} // namespace

template <typename _ExecutionPolicy, typename _Range1, typename _Range2, typename _Range3,
typename _Range4, typename _BinaryPredicate, typename _BinaryOperator>
template <typename _ExecutionPolicy, typename _Range1, typename _Range2, typename _Range3, typename _Range4,
typename _BinaryPredicate, typename _BinaryOperator>
oneapi::dpl::__internal::__difference_t<_Range3>
__parallel_reduce_by_segment_fallback(oneapi::dpl::__internal::__device_backend_tag, _ExecutionPolicy&& __exec, _Range1&& __keys,
_Range2&& __values, _Range3&& __out_keys, _Range4&& __out_values,
_BinaryPredicate __binary_pred, _BinaryOperator __binary_op,
__parallel_reduce_by_segment_fallback(oneapi::dpl::__internal::__device_backend_tag, _ExecutionPolicy&& __exec,
_Range1&& __keys, _Range2&& __values, _Range3&& __out_keys,
_Range4&& __out_values, _BinaryPredicate __binary_pred,
_BinaryOperator __binary_op,
/*known_identity=*/std::true_type)
{
using _CustomName = oneapi::dpl::__internal::__policy_kernel_name<_ExecutionPolicy>;
Expand Down Expand Up @@ -137,11 +138,10 @@ __parallel_reduce_by_segment_fallback(oneapi::dpl::__internal::__device_backend_
auto __seg_reduce_prefix_kernel =
__par_backend_hetero::__internal::__kernel_compiler<_SegReducePrefixKernel>::__compile(__exec);
__wgroup_size =
std::min({__wgroup_size,
oneapi::dpl::__internal::__kernel_work_group_size(__exec, __seg_reduce_count_kernel),
oneapi::dpl::__internal::__kernel_work_group_size(__exec, __seg_reduce_offset_kernel),
oneapi::dpl::__internal::__kernel_work_group_size(__exec, __seg_reduce_wg_kernel),
oneapi::dpl::__internal::__kernel_work_group_size(__exec, __seg_reduce_prefix_kernel)});
std::min({__wgroup_size, oneapi::dpl::__internal::__kernel_work_group_size(__exec, __seg_reduce_count_kernel),
oneapi::dpl::__internal::__kernel_work_group_size(__exec, __seg_reduce_offset_kernel),
oneapi::dpl::__internal::__kernel_work_group_size(__exec, __seg_reduce_wg_kernel),
oneapi::dpl::__internal::__kernel_work_group_size(__exec, __seg_reduce_prefix_kernel)});
#endif

std::size_t __n_groups = oneapi::dpl::__internal::__dpl_ceiling_div(__n, __wgroup_size * __vals_per_item);
Expand Down Expand Up @@ -462,4 +462,3 @@ __parallel_reduce_by_segment_fallback(oneapi::dpl::__internal::__device_backend_
} // namespace oneapi

#endif

0 comments on commit d80377e

Please sign in to comment.