Skip to content
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

thrust fancy iterators should be trivially copy constructible #1367

Closed
miscco opened this issue Feb 12, 2024 Discussed in #562 · 0 comments · Fixed by #1368
Closed

thrust fancy iterators should be trivially copy constructible #1367

miscco opened this issue Feb 12, 2024 Discussed in #562 · 0 comments · Fixed by #1368

Comments

@miscco
Copy link
Collaborator

miscco commented Feb 12, 2024

Discussed in #562

Originally posted by pauleonix October 14, 2023
I am working on a existing CUDA C++ codebase that combines Thrust fancy iterators with eyalroz/cuda-api-wrappers. In recent versions these wrappers have started statically checking the (decayed) type of kernel arguments passed through it's API for std::is_trivially_copyable or even more recently std::is_trivially_copy_constructible. Neither of these requirements is met by Thrust fancy iterators like even the most basic thrust::counting_iterator<int>. As the two of us couldn't reach a conclusion or our own in eyalroz/cuda-api-wrappers#551, we decided to ask here if there is another option to check for correctness without compromising composability with Thrust fancy iterators.

@github-project-automation github-project-automation bot moved this to Todo in CCCL Feb 12, 2024
miscco added a commit to miscco/cccl that referenced this issue Feb 12, 2024
… when possible

Our implementation provides user defined copy constructors, even if that is not necessary, as this was necessary prior to C++11.

Having dropped any support for older standard dialects, we can simply rely on defaulting or even better omitting those copy constructors.

This ensures that thrust fany iterators are trivially_copy_constructible when possible.

I did not rework transform_iterator, as that would require considerable effort due to potentially non copy assignable functors.

Addresses NVIDIA#1367
miscco added a commit that referenced this issue Feb 14, 2024
… when possible (#1368)

Our implementation provides user defined copy constructors, even if that is not necessary, as this was necessary prior to C++11.

Having dropped any support for older standard dialects, we can simply rely on defaulting or even better omitting those copy constructors.

This ensures that thrust fany iterators are trivially_copy_constructible when possible.

I did not rework transform_iterator, as that would require considerable effort due to potentially non copy assignable functors.

Addresses #1367
@github-project-automation github-project-automation bot moved this from Todo to Done in CCCL Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant