-
Notifications
You must be signed in to change notification settings - Fork 196
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]: thrust iterators are not compatible with absl container algorithms. #1679
Comments
Further reduced reproducer (huge thanks to @zygoloid): https://godbolt.org/z/fKh9cWjnz. It indicates that the root cause is an ambiguous function overload caused by both libc++ and libcudacxx providing their own This issue is similar to #1678, just harder to diagnose because the actual failure is hidden by SFINAE. |
For what it's worth, a hacky workaround is to replace the libcudacxx' implementations of |
@zygoloid suggests that
That said, I have no idea how/whether that reasoning would apply to the GPU side of the compilation where the standard does not promise us anything. I.e. we may have a problem if the functions must be |
Oh I also need to look at |
I believe we cannot go with a simple alias, as that does not work on device. What I have done is SFINAE those functions away when they are ambiguous with namespace std. That should be safe, because if somebody pulls in namespace std via ADL, then that type will never be host device and we can just use the function from namespace std. There is the caveat that someone might be using |
would this solve the problem? https://godbolt.org/z/j3djoY1Ys |
It would solve the problem for EDIT: it would solve the problem, but we would need to add those to every sequence |
Is this a duplicate?
Type of Bug
Compile-time Error
Component
Not sure
Describe the bug
Container algorithms from ABSL fail to compile when used w/ thrust iterators. Note that it's completely host-side C++ code, not CUDA.
Note that it's not clear what's at fault here: absl, thrust, libcu++ or my expectations that it should all work.
For what it's worth, the code used to work with an ancient version of thrust (https://github.com/NVIDIA/thrust/tree/f5ea60fd3aa3828c0eb8991a54acdfbed6707bd7)
How to Reproduce
https://godbolt.org/z/a4v4hecsP
Expected behavior
absl algorithms should work with thrust iterators.
Reproduction link
https://godbolt.org/z/a4v4hecsP
Operating System
n/a
nvidia-smi output
n/a
NVCC version
It's a host-side compilation issue. The failure happens with both clang and gcc.
The text was updated successfully, but these errors were encountered: