Skip to content

Commit 5b078ad

Browse files
committed
[oneDPL][ranges][merge] support size limit for output; + fixes for std::min usage
1 parent 75e133e commit 5b078ad

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/oneapi/dpl/pstl/hetero/algorithm_ranges_impl_hetero.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ template <typename _BackendTag, typename _ExecutionPolicy, typename _Function, t
5454
void
5555
__pattern_walk_n(__hetero_tag<_BackendTag>, _ExecutionPolicy&& __exec, _Function __f, _Ranges&&... __rngs)
5656
{
57-
auto __n = std::min({__rngs.size()...});
57+
using _Size = std::make_unsigned_t<std::common_type_t<oneapi::dpl::__internal::__difference_t<_Ranges>...>>;
58+
auto __n = std::min({_Size(__rngs.size())...});
5859
if (__n > 0)
5960
{
6061
oneapi::dpl::__par_backend_hetero::__parallel_for(_BackendTag{}, ::std::forward<_ExecutionPolicy>(__exec),

0 commit comments

Comments
 (0)