Skip to content

Commit

Permalink
include/oneapi/dpl/pstl/hetero/dpcpp/parallel_backend_sycl_merge.h - …
Browse files Browse the repository at this point in the history
…fix review comment: additional comments about __rng1_idx_less_n1 and __rng2_idx_less_n2

Signed-off-by: Sergey Kopienko <[email protected]>
  • Loading branch information
SergeyKopienko committed Dec 18, 2024
1 parent bf18ec8 commit 879b5d2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ __serial_merge(const _Rng1& __rng1, const _Rng2& __rng2, _Rng3& __rng3, _Index _
const bool __rng1_idx_less_n1 = __rng1_idx < __rng1_idx_end;
const bool __rng2_idx_less_n2 = __rng2_idx < __rng2_idx_end;

// Logically, one of __rng1_idx_less_n1 and __rng2_idx_less_n2 should be true here
// because 1) we should fill output data with elements from one of the input ranges
// 2) we calculate __rng3_idx_end as std::min<_Index>(__rng1_size + __rng2_size, __chunk);
__rng3[__rng3_idx] =
__rng1_idx_less_n1 && __rng2_idx_less_n2
? (__comp(__rng2[__rng2_idx], __rng1[__rng1_idx]) ? __rng2[__rng2_idx++] : __rng1[__rng1_idx++])
Expand Down

0 comments on commit 879b5d2

Please sign in to comment.