-
Notifications
You must be signed in to change notification settings - Fork 222
Cudeviceptr conversion #4897
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
base: main
Are you sure you want to change the base?
Cudeviceptr conversion #4897
Conversation
Co-authored-by: Michael Schellenberger Costa <[email protected]>
Co-authored-by: Michael Schellenberger Costa <[email protected]>
thrust/thrust/device_ptr.h
Outdated
//! \brief Converts this \c device_ptr to a raw \c CUdeviceptr. | ||
_CCCL_HOST_DEVICE operator CUdeviceptr() const noexcept |
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.
Critical: Unfortunately, this breaks a lot of tests with gcc, because now device_ptr + offset
is ambigious, for example:
/home/bgruber/dev/cccl/thrust/testing/cuda/device_ptr.cu:8:60: required from here
8 | thrust::device_vector<int> vec(3);
| ^
/home/bgruber/dev/cccl/lib/cmake/thrust/../../../thrust/thrust/system/cuda/detail/uninitialized_fill.h:79:14: error: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [-Werror]
79 | return first + count;
| ~~~~~~^~~~~~~
The operator needs to be explicit
.
I pushed a unit test and made the conversion |
/ok to test 037b904 |
🟩 CI finished in 1h 56m: Pass: 100%/130 | Total: 3d 02h | Avg: 34m 31s | Max: 1h 31m | Hits: 80%/163253
|
Project | |
---|---|
CCCL Infrastructure | |
CCCL Packaging | |
libcu++ | |
CUB | |
+/- | Thrust |
CUDA Experimental | |
stdpar | |
python | |
CCCL C Parallel Library | |
Catch2Helper |
Modifications in project or dependencies?
Project | |
---|---|
CCCL Infrastructure | |
+/- | CCCL Packaging |
libcu++ | |
+/- | CUB |
+/- | Thrust |
+/- | CUDA Experimental |
+/- | stdpar |
python | |
+/- | CCCL C Parallel Library |
+/- | Catch2Helper |
🏃 Runner counts (total jobs: 130)
# | Runner |
---|---|
89 | linux-amd64-cpu16 |
11 | windows-amd64-cpu16 |
10 | linux-arm64-cpu16 |
7 | linux-amd64-gpu-rtx2080-latest-1 |
6 | linux-amd64-gpu-rtxa6000-latest-1 |
4 | linux-amd64-gpu-h100-latest-1 |
3 | linux-amd64-gpu-rtx4090-latest-1 |
I think with the explicit operator is not worth the extra include and potential ODR violations from the ifdefed member. |
Description
closes #4896
Checklist