Skip to content

Commit

Permalink
++
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDvorskiy committed Jan 29, 2025
1 parent 39dbeed commit 9780273
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions include/oneapi/dpl/pstl/algorithm_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2948,7 +2948,8 @@ __pattern_remove_if(__parallel_tag<_IsVector> __tag, _ExecutionPolicy&& __exec,
//------------------------------------------------------------------------
// merge
//------------------------------------------------------------------------

//Serial version of ___merge_path_out_lim merges 1st sequience and 2nd sequience in "revert maner":
//the identical elements from 2nd sequience are being merged first.
template <typename _Iterator1, typename _Iterator2, typename _Iterator3, typename _Comp>
std::pair<_Iterator1, _Iterator2>
__serial_merge_out_lim(_Iterator1 __x, _Iterator1 __x_e, _Iterator2 __y, _Iterator2 __y_e, _Iterator3 __i,
Expand Down Expand Up @@ -3020,10 +3021,7 @@ std::pair<_It1, _It2>
___merge_path_out_lim(_Tag, _ExecutionPolicy&& __exec, _It1 __it_1, _Index1 __n_1, _It2 __it_2, _Index2 __n_2,
_OutIt __it_out, _Index3 __n_out, _Comp __comp)
{
//___merge_path_out_lim is called with reverse order: (2nd sequience, 1st sequience)
//__serial_merge_out_lim does merging in direct order: (1st sequience and 2nd sequience).
// So, the following call passes 1st sequience 2nd sequience in "a revert maner".
return __serial_merge_out_lim(__it_2, __it_2 + __n_2, __it_1, __it_1 + __n_1, __it_out, __it_out + __n_out, __comp);
return __serial_merge_out_lim(__it_1, __it_1 + __n_1, __it_2, __it_2 + __n_2, __it_out, __it_out + __n_out, __comp);
}

inline constexpr std::size_t __merge_path_cut_off = 2000;
Expand Down
2 changes: 1 addition & 1 deletion include/oneapi/dpl/pstl/algorithm_ranges_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ __pattern_merge(_Tag __tag, _ExecutionPolicy&& __exec, _R1&& __r1, _R2&& __r2, _
if (__n_out == 0)
return __return_type{__it_1, __it_2, __it_out};

//Parallel version of ___merge_path_out_lim merges 1st sequience and 2nd sequience in "revert maner":
//Parallel and serial versions of ___merge_path_out_lim merges 1st sequience and 2nd sequience in "revert maner":
//the identical elements from 2nd sequience are being merged first.
//So, the following call passes 1st sequience 2nd sequience in "a revert maner".
std::pair __res = ___merge_path_out_lim(__tag, std::forward<_ExecutionPolicy>(__exec), __it_2, __n_2, __it_1, __n_1,
Expand Down

0 comments on commit 9780273

Please sign in to comment.