We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
cuda::std::nullopt
Compile-time Error
libcu++
Attempting to construct a cuda::std::pair that contains a cuda::std::nullopt fails to compile.
cuda::std::pair
#include <cuda/std/optional> #include <thrust/for_each.h> #include <thrust/execution_policy.h> using cuda::std::pair; using cuda::std::nullopt; using cuda::std::optional; __global__ void test(int* x, pair<int, optional<int>>* y) { thrust::for_each(thrust::seq, x, x+1, [&](auto const& i) { y[i] = {i, nullopt}; }); } int main(void) { test<<<1, 1, 1>>>(nullptr, nullptr); }
$ nvcc -c /tmp/test_nullopt.cu -o /tmp/test_nullopt.cu.o /tmp/test_nullopt.cu(11): error: identifier "cuda::std::__4::nullopt" is undefined in device code
The code works
https://godbolt.org/z/K7q3KcaP9
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Is this a duplicate?
Type of Bug
Compile-time Error
Component
libcu++
Describe the bug
Attempting to construct a
cuda::std::pair
that contains acuda::std::nullopt
fails to compile.How to Reproduce
cuda::std::pair
that contains acuda::std::nullopt
in a device lambdaExpected behavior
The code works
Reproduction link
https://godbolt.org/z/K7q3KcaP9
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered: