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

std::trivially-copyable requirement for kernel parameters too strong #321

Closed
eyalroz opened this issue Apr 21, 2022 · 0 comments
Closed

Comments

@eyalroz
Copy link
Owner

eyalroz commented Apr 21, 2022

We currently require all (decayed types of) parameters to kernel functions satisfy the TriviallyCopyable C++ named set of requirements:

  • Scalar types
  • Trivially copyable classes, i.e. classes satisfying following requirements:
    • At least one copy constructor, move constructor, copy assignment operator, or move assignment operator is eligible
    • Every eligible copy constructor (if any) is trivial
    • Every eligible move constructor (if any) is trivial
    • Every eligible copy assignment operator (if any) is trivial
    • Every eligible move assignment operator (if any) is trivial
    • Has a trivial non-deleted destructor
  • Arrays of TriviallyCopyable objects

That's too strong of a requirement. It's enough for us that the CUDA driver be able to copy the representation bytes of the class/struct, and construct a representation on the GPU using those bytes. The existence of other operators and ctors is inconsequential (well, I think so, any way). So, let's weaken the use std::is_trivially_copyable to std::is_trivially_copy_cosntructible.

@eyalroz eyalroz added the task label Apr 21, 2022
@eyalroz eyalroz self-assigned this Apr 21, 2022
@eyalroz eyalroz changed the title std::trivially-copyable requirement for kernel arguments too strong std::trivially-copyable requirement for kernel parameters too strong Apr 21, 2022
@eyalroz eyalroz closed this as completed in dfbeb0c May 9, 2022
eyalroz added a commit that referenced this issue Jun 20, 2022
…trivially_copyable` to `std::is_trivially_copy_cosntructible`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant