Skip to content

Commit 67f2795

Browse files
committed
defer set ordering check to parallel_set_op
Signed-off-by: Dan Hoeflinger <dan.hoeflinger@intel.com>
1 parent 62f2c08 commit 67f2795

File tree

1 file changed

+4
-30
lines changed

1 file changed

+4
-30
lines changed

include/oneapi/dpl/pstl/algorithm_impl.h

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3399,22 +3399,6 @@ __parallel_set_op(__parallel_tag<_IsVector>, _ExecutionPolicy&& __exec, _RandomA
33993399
});
34003400
}
34013401

3402-
template <typename _SetOp>
3403-
struct __swap_set_op
3404-
{
3405-
_SetOp __set_op;
3406-
3407-
template <typename _RandomAccessIterator1, typename _RandomAccessIterator2, typename _OutputIterator,
3408-
typename _Compare, typename _Proj1, typename _Proj2>
3409-
_OutputIterator
3410-
operator()(_RandomAccessIterator2 __first2, _RandomAccessIterator2 __last2, _RandomAccessIterator1 __first1,
3411-
_RandomAccessIterator1 __last1, _OutputIterator __result, _Compare __comp, _Proj2 __proj2,
3412-
_Proj1 __proj1) const
3413-
{
3414-
return __set_op(__first1, __last1, __first2, __last2, __result, __comp, __proj1, __proj2);
3415-
}
3416-
};
3417-
34183402
//a shared parallel pattern for '__pattern_set_union' and '__pattern_set_symmetric_difference'
34193403
template <class _IsVector, class _ExecutionPolicy, class _RandomAccessIterator1, class _RandomAccessIterator2,
34203404
class _OutputIterator, class _SetUnionOp, class _Compare, class _Proj1, class _Proj2>
@@ -3517,20 +3501,10 @@ __parallel_set_union_op(__parallel_tag<_IsVector> __tag, _ExecutionPolicy&& __ex
35173501
__internal::__pattern_walk2_brick(__tag, __exec, __first2, __begin2, __res_or, __copy_range);
35183502
},
35193503
[=, &__exec, &__result] {
3520-
if (__n1 >= __n2)
3521-
{
3522-
__result = __internal::__parallel_set_op(
3523-
__tag, __exec, __begin1, __last1, __begin2, __last2, __result,
3524-
[](_DifferenceType __n, _DifferenceType __m) { return __n + __m; }, __set_union_op, __comp, __proj1,
3525-
__proj2);
3526-
}
3527-
else
3528-
{
3529-
__result = __internal::__parallel_set_op(
3530-
__tag, __exec, __begin2, __last2, __begin1, __last1, __result,
3531-
[](_DifferenceType __n, _DifferenceType __m) { return __n + __m; },
3532-
__swap_set_op<_SetUnionOp>{__set_union_op}, __comp, __proj2, __proj1);
3533-
}
3504+
__result = __internal::__parallel_set_op(
3505+
__tag, __exec, __begin1, __last1, __begin2, __last2, __result,
3506+
[](_DifferenceType __n, _DifferenceType __m) { return __n + __m; }, __set_union_op, __comp, __proj1,
3507+
__proj2);
35343508
});
35353509
return __result;
35363510
}

0 commit comments

Comments
 (0)