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

Move execution policies, algorithm, numeric, memory details to internal headers #9

Merged
merged 6 commits into from May 15, 2018

Conversation

rodgert
Copy link
Contributor

@rodgert rodgert commented Apr 6, 2018

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 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>
Copy link
Contributor

@andreyfe1 andreyfe1 Apr 9, 2018

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

Copy link
Contributor Author

@rodgert rodgert Apr 9, 2018

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.

Copy link
Contributor

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) {
Copy link
Contributor

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>.
@rodgert
Copy link
Contributor Author

rodgert commented Apr 9, 2018

Commit 6621df6 fixes _InputIterator => ForwardIterator

@rodgert rodgert changed the title Move execution policies to internal headers Move execution policies, algorithm, numeric, memory details to internal headers Apr 9, 2018
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>
@rodgert
Copy link
Contributor Author

rodgert commented Apr 17, 2018

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.

@tbbdev tbbdev merged commit b3b052e into oneapi-src:master May 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants