Open jzarnett opened 3 years ago
Hey, thanks for the suggestion!
Honestly, I don't really use or work on RustaCUDA anymore. It's been a while since I did any GPGPU work.
That does seem like a useful feature though. If you're interested in sending a pull request, I'd be happy to help polish it up and get it merged in.
Would you consider adding built-in support for the vector types used in kernels like
float4
and the other built-in vector types forchar, short, int, long, longlong, float, double
listed in the CUDA Documentation?If I want to use them, I can make my own definition or import them from another library, but I cannot use them in a direct, convenient way because the types don't implement the
DeviceCopy
trait that would be needed for sending it over to the kernel.My current workaround looks something like this, because of course I can't add traits to a type that isn't mine.
Also, when I am creating one, there's a tiny bit of extra ceremony in that I have to add the
0: float4 { }
around the definition, such as:Although I'm not an expert in CUDA, I imagine these vector types are likely to be commonly used and it would be convenient for users of the library to have these supported directly in RustaCUDA. I do have a full (working) example with my workaround as above if more is needed. Thanks!
(Please pardon my ignorance if this is implemented somewhere in RustaCUDA and I've failed to find it.)