-
Notifications
You must be signed in to change notification settings - Fork 190
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
[BUG]: cuda::std::swap
cannot ADL-two-step-swap a type from std
#2984
Comments
There is nothing we can do here. The issue is that ADL will always pull in Nothing we can do here the moment something pulls in |
So, how do we swap two objects in a generic context? Like swapping two allocators which could come from |
* Fix swapping types from namespace std * Replace thrust::swap by cuda::std::swap Fixes: #2984 Fixes: #2948 Co-authored-by: Michael Schellenberger Costa <[email protected]>
Is this a duplicate?
Type of Bug
Compile-time Error
Component
libcu++
Describe the bug
While trying to write a function in Thrust that needs to swap allocators from
std
andthrust
, I ran into the issue thatcuda::std::swap
fails to swap them.How to Reproduce
https://godbolt.org/z/Ea1d1TWdo
Errors with:
I think this should work, since the ADL-two-step call is required to pick up any user-provided
swap
overload.Expected behavior
Compile successfully.
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered: