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
Move execution policies, algorithm, numeric, memory details to internal headers #9
Conversation
This is in preparation for libstdc++ integration The pstl policies themselves move to internal/execution_defs.h internal/execution_impl.h now refers to internal/execution_defs.h instead of ../execution The injection of pstl execution policies into namespace std:: moves to internal/glue_execution_defs.h In general, libstdc++ will re-export the internal/glue_*.h files from the pstl implementation.
This change splits the contents of <algorithm> to two internal "glue" headers for integration with libstdc++ as follows - internal/glue_algorithm_defs.h - Includes only function prototypes, and is included by <algorithm> internal/glue_algorithm_impl.h - Has all implementation previously in <algorithm> this header is only included in <execution>. This will prevent compile-time regressions for consumers of <algorithm> (in libstdc++) which do not currently use the parallel versions of the algorithms, which are always dependent on execution policy, and thus always dependent on <execution>.
|
||
// [partial.sort.copy] | ||
|
||
template<class ExecutionPolicy, class _InputIterator, class RandomAccessIterator, class Compare> |
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.
ForwardIterator and RandomAccessIterator are used here according to N4700 and even N4659.
I believe ForwardIterator should be used instead of _InputIterator as you write below for partial_sort_copy without Compare
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.
It looks like I missed these on my pass through, I'm going to be ameding this PR with <numeric>
and <memory>
shortly, I'll fix this as well.
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.
Thank you for quick fixing
|
||
template<class ExecutionPolicy, class _InputIterator, class RandomAccessIterator, class Compare> | ||
pstl::internal::enable_if_execution_policy<ExecutionPolicy, RandomAccessIterator> | ||
partial_sort_copy(ExecutionPolicy&& exec, _InputIterator first, _InputIterator last, RandomAccessIterator d_first, RandomAccessIterator d_last, Compare comp) { |
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.
The same comment as in glue_algorithm_defs.h
This change splits the contents of <algorithm> to two internal "glue" headers for integration with libstdc++ as follows - internal/glue_algorithm_defs.h - Includes only function prototypes, and is included by <algorithm> internal/glue_algorithm_impl.h - Has all implementation previously in <algorithm> this header is only included in <execution>. This will prevent compile-time regressions for consumers of <algorithm> (in libstdc++) which do not currently use the parallel versions of the algorithms, which are always dependent on execution policy, and thus always dependent on <execution>.
Commit 6621df6 fixes _InputIterator => ForwardIterator |
This is in preparation for integration with libstdc++ These changes are analogous to the changes in a previous commit for <algorithm>
internal/glue_memory_impl.h was not in previous commit
Also, conditionally pulls in only those implementation headers required if <algorithm> <numeric> and <memory> are included before <execution>
I've added the conditional include checks we discussed over email. FWIW, at least for the test suite build times, it makes no difference in compiler timings. |
This is in preparation for libstdc++ integration
The pstl policies themselves move to internal/execution_defs.h
internal/execution_impl.h now refers to internal/execution_defs.h instead of
../execution
The injection of pstl execution policies into namespace std:: moves to
internal/glue_execution_defs.h
In general, libstdc++ will re-export the internal/glue_*.h files from the pstl
implementation.