Closed dkolsen-pgi closed 1 week ago
Confirmed reproducer on CCCL main and nvcc 12.4 https://godbolt.org/z/G1cs38xYb
@alliepiper would you mind looking into this?
This is blocking my implementation of nvc++ -stdpar=gpu,multicore
. I was hoping to check in the feature this week, but I can't check it in to the NVHPC dev branch until this issue is fixed in the CCCL main branch. And we can't release the feature, scheduled for HPC SDK 24.9 in late September, until the fix for this issue is in a CCCL release.
So this issue is urgent.
(My apologies for not speaking up about this sooner. I was on vacation for a couple weeks and forgot about this.)
Taking a look now.
The break bisects to 91b78d8f8.
If this is an important use case for nvc++, can we extend the CI to cover this scenario? And if it is already covered, do we know why the CI missed this issue? Never mind, just saw the issue: #2333
Even if CCCL had excellent CI coverage for NVC++, it wouldn't have caught this bug. This bug only affects a new feature that I am working on, which is not in production yet. The bug may have been caught if #2333 had been implemented, but it wouldn't have been caught by NVC++ coverage.
Thanks for the fix, Allison. Compilation gets farther along. But it runs into another error that looks like the same problem.
"/home/dolsen/work/pgi/dev/nv/Linux_x86_64/mine/compilers/include-stdpar/thrust/mr/host_memory_resource.h", line 36: error: namespace "thrust::THRUST_200600_86_NS::system::cpp" has no member "memory_resource"
using host_memory_resource = thrust::system::cpp::memory_resource;
^
That line in <thrust/mr/host_memory_resource.h>
looks wrong and I assume should have the same fix.
I also found three other uses of thrust::system::cpp::detail::execution_policy
in files that are not in thrust/system/cpp
. I don't know if thrust::system::cpp::detail::execution_policy
exists when the host system is not CPP, so I don't know if these are actual problems. The files in question are thrust/detail/overlapped_copy.h
, thrust/system/omp/detail/execution_policy.h
, and thrust/system/tbb/detail/execution_policy.h
.
I looked into the offending commit using git show 91b78d8 | grep -C 3 __THRUST_HOST_SYSTEM_NAMESPACE
and I find two occurences where __THRUST_HOST_SYSTEM_NAMESPACE
was erroneously replaced by cpp
. One of them was fixes in #2332, the other one is proposed here: #2341
I also found three other uses of
thrust::system::cpp::detail::execution_policy
in files that are not inthrust/system/cpp
. I don't know ifthrust::system::cpp::detail::execution_policy
exists when the host system is not CPP, so I don't know if these are actual problems. The files in question arethrust/detail/overlapped_copy.h
,thrust/system/omp/detail/execution_policy.h
, andthrust/system/tbb/detail/execution_policy.h
.
I looked at those files and annotated the locations with git blame
, but those locations were not touched in commit 91b78d8. Notice that the offending commit only rewrote typedef
to using
.
Is this a duplicate?
Type of Bug
Compile-time Error
Component
Thrust
Describe the bug
It used to be possible, at least through CCCL 2.3.0, to use the Thrust OpenMP and CUDA back ends in the same compilation, choosing which back end to use at each algorithm call by specifying different execution policies,
thrust::omp::par
andthrust::cuda::par
respectively. This was done by definingbefore including any Thrust headers.
This no longer works with the CCCL main branch. It results in compilation errors. See the reproduction steps below.
This Thrust feature is necessary to implement
nvc++ -stdpar=gpu,multicore
, which is a much requested feature that we are hoping to implement for the next NVC++ release.How to Reproduce
Test file:
To reproduce with the NVC++ dev compiler, which uses the latest CCCL main branch.
It can also be reproduced with NVCC (since many don't have easy access to the NVC++ dev compiler). The paths here are in the NVHPC environment, but it should be easy enough to change the paths to work in the CCCL dev environment.
Expected behavior
Everything should just work when using Thrust after:
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response