eyalroz / cuda-api-wrappers

Thin, unified, C++-flavored wrappers for the CUDA APIs
BSD 3-Clause "New" or "Revised" License
766 stars 79 forks source link

Offer a builder for CUDA arrays and/or array descriptors #611

Open eyalroz opened 5 months ago

eyalroz commented 5 months ago

It would be nicer to let our users build arrays not just with descriptors they provide, but in a proper builder pattern.

Now, we would want a builder to also be usable for building just a descriptor for later use, and so we'll need to choose between a few options:

  1. Builder for descriptors, no builder for arrays - you still only construct them using a descriptor.
  2. Builder for descriptors, different builder for arrays (so that you don't have to know about descriptors); may share some code under the hood or even have the latter hold the former.
  3. Builder for arrays, no builder for descriptors - encouraging users against using descriptors themselves (they can copy the builder around)
  4. The descriptor wrapper class will itself be a descriptor for arrays.

I'm tending towards option 4, but not certain yet.