Skip to content

Commit

Permalink
[oneDPL][ranges][merge] support size limit for output; + __parallel_m…
Browse files Browse the repository at this point in the history
…erge sycl pattern support
  • Loading branch information
MikeDvorskiy committed Nov 28, 2024
1 parent 01c63ce commit 1f1562b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ template <typename _BackendTag, typename _ExecutionPolicy, typename _Function, t
void
__pattern_walk_n(__hetero_tag<_BackendTag>, _ExecutionPolicy&& __exec, _Function __f, _Ranges&&... __rngs)
{
auto __n = oneapi::dpl::__ranges::__get_first_range_size(__rngs...);
auto __n = std::min({__rngs...});
if (__n > 0)
{
oneapi::dpl::__par_backend_hetero::__parallel_for(_BackendTag{}, ::std::forward<_ExecutionPolicy>(__exec),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct __parallel_merge_submitter<_IdType, __internal::__optional_kernel_name<_N
{
const _IdType __n1 = __rng1.size();
const _IdType __n2 = __rng2.size();
const _IdType __n = __n1 + __n2;
const _IdType __n = std::min<_IdType>(__n1 + __n2, std::ranges::size(__rng3));

assert(__n1 > 0 || __n2 > 0);

Expand Down

0 comments on commit 1f1562b

Please sign in to comment.