Closed ChipsSpectre closed 4 years ago
Hi,
What you're looking for is DeviceBuffer
. The examples in the documentation show how you can transfer data to and from the device with copy_to
and copy_from
. You can also perform the copies asynchronously with async_copy_to
and async_copy_from
, see the documentation for AsyncCopyDestination
.
Hope that helps!
Thank you really much, this helped a lot! The device buffer is now used in a minimal version. Is it possible to add it to the examples section?
Looks almost exactly like the existing launch example to me.
I am sorry, I did not look into the examples folder. Sometimes the solution is closer than one might think...
But nonetheless, thank you really much for mentioning the DeviceBuffer, I started to implement some kernels and RustaCUDA works great. :+1:
Great that it's working for you now! I guess the README could link to the examples folder to make the examples easier to find. Perhaps @bheisler would accept a pull request from you?
:+1: Pull request created.
Pull request has been merged.
Hey,
I just discovered this project and it looks really interesting!
The way how data is allocated on the GPU device looks like this for a scalar value.
let mut factor1 = DeviceBox::new(&6.0f32)?;
How can we allocate a vector of values on the device? For example: If we want to increment all values in a vector
[1,2,3]
, how can this vector be transferred to the device?It would be great for me to to add this information to the API documentation in order to help future users.
Best regards Chips