This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 758
Create include wrappers for algorithm and memory #1218
Comments
dkolsen-pgi
added a commit
that referenced
this issue
Jul 2, 2020
Accommodate compilers that use Thrust in their implementations of C++ Standard algorithms. To avoid cycles of include files, the compiler needs to know when an include of an algorithms-related header (<algorithm>, <numeric>, or <memory>) is coming from Thrust vs from user code. Create wrapper files to use when including <algorithm> or <memory> that defines a macro that the compiler can check to know where the include is coming from. Change all includes of those files within Thrust code to include the wrapper file instead. (The same change would also be made for <numeric> if Thrust files included <numeric> anywhere.) Fix #1218
alliepiper
pushed a commit
that referenced
this issue
Jul 3, 2020
Accommodate compilers that use Thrust in their implementations of C++ Standard algorithms. To avoid cycles of include files, the compiler needs to know when an include of an algorithms-related header (<algorithm>, <numeric>, or <memory>) is coming from Thrust vs from user code. Create wrapper files to use when including <algorithm> or <memory> that defines a macro that the compiler can check to know where the include is coming from. Change all includes of those files within Thrust code to include the wrapper file instead. (The same change would also be made for <numeric> if Thrust files included <numeric> anywhere.) Fix #1218
alliepiper
pushed a commit
that referenced
this issue
Jul 3, 2020
Accommodate compilers that use Thrust in their implementations of C++ Standard algorithms. To avoid cycles of include files, the compiler needs to know when an include of an algorithms-related header (<algorithm>, <numeric>, or <memory>) is coming from Thrust vs from user code. Create wrapper files to use when including <algorithm> or <memory> that defines a macro that the compiler can check to know where the include is coming from. Change all includes of those files within Thrust code to include the wrapper file instead. (The same change would also be made for <numeric> if Thrust files included <numeric> anywhere.) Fix #1218
dkolsen-pgi
added a commit
that referenced
this issue
Jul 10, 2020
Yesterday "#include <memory>" was added to thrust/detail/allocator/allocator_traits.inl. That caused a regression when compiling with NVC++, breaking #1218. This fix changes that include to be "#include <thrust/detail/memory_wrapper.h>". (And it makes the same change to a different include of <memory> that I seem to have missed in my earlier commit.)
alliepiper
pushed a commit
that referenced
this issue
Jul 10, 2020
Yesterday "#include <memory>" was added to thrust/detail/allocator/allocator_traits.inl. That caused a regression when compiling with NVC++, breaking #1218. This fix changes that include to be "#include <thrust/detail/memory_wrapper.h>". (And it makes the same change to a different include of <memory> that I seem to have missed in my earlier commit.)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When compiling with NVC++, it is possible that
#include <thrust/host_vector.h>
will result in circular includes, inthrust::host_vector
being used before it is defined, and in a cascading series of meaningless compilation errors. The fix for this requires cooperation between NVC++ and Thrust. On the Thrust, side all includes of<algorithm>
,<numeric>
, and<memory>
need to be replaced by<thrust/detail/algorithm.h>
(or similar) which wraps the include of the real file with a define/undef of a macro than NVC++ can look for.The text was updated successfully, but these errors were encountered: