-
Notifications
You must be signed in to change notification settings - Fork 115
Unify the "regular" and "bounded" implementations for copy_if #2538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
90501f7 to
09de756
Compare
Simplify __brick_bounded_copy_by_mask
Adjust __pattern_bounded_copy_if to the new brick semantics
caec240 to
2640691
Compare
|
I think the declaration of template <bool, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Bound, class _Assigner>
_Bound
__brick_copy_by_mask(_RandomAccessIterator1, _Bound, _RandomAccessIterator2, _Bound, bool*, _Assigner,
/*vector=*/std::false_type) noexcept;
template <bool, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Bound, class _Assigner>
_Bound
__brick_copy_by_mask(_RandomAccessIterator1, _Bound, _RandomAccessIterator2, _Bound, bool*, _Assigner,
/*vector=*/std::true_type) noexcept;not aligned with the implementations: template <bool __Bounded, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Bound, class _Assigner>
_Bound
__brick_copy_by_mask(_RandomAccessIterator1 __first, _Bound __in_len, _RandomAccessIterator2 __result, _Bound __out_len,
bool* __mask, _Assigner __assigner, /*vector=*/std::false_type) noexcept
{
// ,,,
}
template <bool __Bounded, class _RandomAccessIterator1, class _RandomAccessIterator2, class _Bound, class _Assigner>
_Bound
__brick_copy_by_mask(_RandomAccessIterator1 __first, _Bound __in_len, _RandomAccessIterator2 __result, _Bound __out_len,
bool* __mask, _Assigner __assigner, /*vector=*/std::true_type) noexcept
{
return __unseq_backend::__simd_copy_by_mask<__Bounded>(__first, __in_len, __result, __out_len, __mask, __assigner);
} |
|
One more question. template <class _IsVector, class _ExecutionPolicy, class _RandomAccessIterator1, class _DifferenceType,
class _RandomAccessIterator2, class _UnaryPredicate>
std::pair<_RandomAccessIterator1, _RandomAccessIterator2>
__pattern_bounded_copy_if(__parallel_tag<_IsVector>, _ExecutionPolicy&&, _RandomAccessIterator1, _DifferenceType,
_RandomAccessIterator2, _DifferenceType, _UnaryPredicate);Why we can't use two iterators (begin and end) ? |
I have checked and have not found any misalignment, aside from omitted names in the forward declarations.
The only caller of
Most (if not all) other |
SergeyKopienko
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
MikeDvorskiy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
On top of #2499, this patch unifies the copy_if implementation for parallel and vector policies. combining much of the code previously separate for the "bounded" ranges::copy_if and the "regular" C++17 copy_if.