You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would you consider adding built-in support for the vector types used in kernels like float4 and the other built-in vector types for char, 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.
struct CudaFloat4(float4);
unsafe impl DeviceCopy for CudaFloat4 {}
impl Deref for CudaFloat4 {
type Target = float4;
fn deref(&self) -> &Self::Target {
&self.0
}
}
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.)
The text was updated successfully, but these errors were encountered:
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.)
The text was updated successfully, but these errors were encountered: