NVIDIA / cuCollections

Apache License 2.0
480 stars 88 forks source link

[FEA] Variadic ctor parameters #207

Open sleeepyjack opened 2 years ago

sleeepyjack commented 2 years ago

Part of #110 (Refactor of open address data structures)

Development branch: NVIDIA/cuCollections/refactor

Synopsis

To make it convenient to construct a static_set or other data structures with a variety of configuration parameters, we want to use a variadic constructor pattern.

TODOs

References

sleeepyjack commented 2 years ago

Initial prototype: https://godbolt.org/z/Kj763Teon

This approach still needs some refinement but enables us to use fully variadic ctors if we opt for strong types for all parameters. We could also use this in member functions to pass optional parameters,e.g., pass an optional CUDA stream to one of the bulk functions.

Build on gcc works but nvcc fails to understand the deduction guide. Investigating...

sleeepyjack commented 2 years ago

New version: tested on gcc, nvcc 11.0-11.7 and has better diagnostics: https://godbolt.org/z/5Ghac54E6