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

[ENHANCEMENT]: Allow conversion between cuco::extent and cuda::std::extent #592

Open
sleeepyjack opened this issue Aug 27, 2024 · 0 comments
Labels
P2: Nice to have Desired, but not necessary type: improvement Improvement / enhancement to an existing function

Comments

@sleeepyjack
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

Introduction of cuda::std::span allows us to move away from the old-school but footgunny raw pointer + size interface.
cuda::std::span allows for passing a cuda::std::extent for the size of the span which can be either a runtime or compile time value.

This is similar to our cuco::extent implementation, with the only difference that the cuco:: version allows for customizing the size type (for performance reasons) while the cuda::std:: implementation always uses size_t.

To make handling of span in cuco easier, it would be nice to be able to easily convert a cuco::extent to a cuda::std::extent.

Describe the solution you'd like

Implement a conversion operator that maps cuco::extent<SizeType, Size> -> cuda::std::extent<Size>.
For the inverse case cuda::std::extent<Size> -> cuco::extent<size_t, Size> there's the caveat that we can only use size_t as the size type.

Describe alternatives you've considered

Travel back in time and standardize std::extent<Size = dynamic_extent, SizeType = size_t> ;)

Additional context

No response

@sleeepyjack sleeepyjack added P2: Nice to have Desired, but not necessary type: improvement Improvement / enhancement to an existing function labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2: Nice to have Desired, but not necessary type: improvement Improvement / enhancement to an existing function
Projects
None yet
Development

No branches or pull requests

1 participant