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

[BUG]: thrust::transform_iterator<F, ...> is broken if F is not copy_assignable #2393

Open
1 task done
bernhardmgruber opened this issue Sep 9, 2024 · 0 comments
Open
1 task done
Labels
bug Something isn't working right.

Comments

@bernhardmgruber
Copy link
Contributor

Is this a duplicate?

Type of Bug

Silent Failure

Component

Thrust

Describe the bug

If the transformation function object of a thrust::transform_iterator is not copy_assignable (e.g., if it contains a const data member), then thrust::transform_iterator is still copyable, but it will just omit copying the contained transformation function. If the latter contains state, than this state is not copied and the transform iterator gives wrong results.

How to Reproduce

Godbolt: https://godbolt.org/z/qbGxh31qE

Expected behavior

thrust::transform_iterator's special member functions should fail to compile if the corresponding special member function is not supported on the wrapped user-provided function. If the latter is not copyable assignable, the transform iterator should also fail to compile if copy assignment is attempted.

Reproduction link

No response

Operating System

No response

nvidia-smi output

No response

NVCC version

No response

@bernhardmgruber bernhardmgruber added the bug Something isn't working right. label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working right.
Projects
Status: Todo
Development

No branches or pull requests

1 participant