cuCollections icon indicating copy to clipboard operation
cuCollections copied to clipboard

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

Open sleeepyjack opened this issue 2 years ago • 1 comments

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 avatar Aug 27 '24 21:08 sleeepyjack

@sleeepyjack Can I still work on it?

arcusbuilds avatar Jul 30 '26 21:07 arcusbuilds

Hi @arcusbuilds,

Sorry for the delay. I would say this issue is stale since we are actively moving cuco into NVIDIA/cccl where we already switched to using cuda::std::extents.

sleeepyjack avatar Aug 04 '26 23:08 sleeepyjack