Skip to content
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

<xutility>: copy_backward() and move_backward() shouldn't have been parallelized #2626

Closed
StephanTLavavej opened this issue Mar 30, 2022 · 1 comment · Fixed by #2627
Closed
Labels
bug Something isn't working fixed Something works now, yay!

Comments

@StephanTLavavej
Copy link
Member

We implemented:

STL/stl/inc/xutility

Lines 4260 to 4267 in 2787718

#if _HAS_CXX17
template <class _ExPo, class _BidIt1, class _BidIt2, _Enable_if_execution_policy_t<_ExPo> = 0>
_BidIt2 copy_backward(_ExPo&&, _BidIt1 _First, _BidIt1 _Last, _BidIt2 _Dest) noexcept /* terminates */ {
// copy [_First, _Last) backwards to [..., _Dest)
// not parallelized as benchmarks show it isn't worth it
return _STD copy_backward(_First, _Last, _Dest);
}
#endif // _HAS_CXX17

STL/stl/inc/xutility

Lines 4342 to 4349 in 2787718

#if _HAS_CXX17
template <class _ExPo, class _BidIt1, class _BidIt2, _Enable_if_execution_policy_t<_ExPo> = 0>
_BidIt2 move_backward(_ExPo&&, _BidIt1 _First, _BidIt1 _Last, _BidIt2 _Dest) noexcept /* terminates */ {
// move [_First, _Last) backwards to [..., _Dest)
// not parallelized as benchmarks show it isn't worth it
return _STD move_backward(_First, _Last, _Dest);
}
#endif // _HAS_CXX17

I don't see these overloads declared or defined in WG21-N4910, and I don't see them mentioned in the original paper P0024R2 anywhere (including in the table of algorithms being parallelized; notably, that table did mention the algorithms we missed in #525).

I think we went too far, and that we should remove these overloads and any associated test coverage. I am skipping them for Standard Library Modules as they are non-Standard.

@StephanTLavavej StephanTLavavej added the bug Something isn't working label Mar 30, 2022
@StephanTLavavej
Copy link
Member Author

I'll create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Something works now, yay!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant