Multi GPU Support
nickmachnik opened this issue · 2 comments
Description
Dear Devs, thanks for the crate, I find it immensely useful!
I was wondering if there is any way to split work among multiple GPUs through the Rust API? I cannot to find any examples or documentation on this, Without having tried it myself, it seems like this is possible through the c++ API, see @9prady9 's gist here or this post on the official AF blog.
@nickmachnik Thank you for using the crate.
The C++ example should be easily translatable to rust. Except few API differences like where
becoming locate
in rust, the library itself doesn't change it's capabilities across languages. 99% of API calls are async, you can write a loop shown in the gist in rust too. You have to call set_device
in each thread to make sure the compute backend's thread context is properly initialized. You can see that I am doing that in C++ example here. In rust equivalent call is arrayfire::set_device
.
Cool, thanks for the pointers, will give this a go!