Reputation: 5017
How do I use Thrust with multiple GPUs? Is it simply a matter of using cudaSetDevice(deviceId) and then running the relevant Thrust code?
Upvotes: 4
Views: 1497
Reputation: 27809
With CUDA 4.0 or later, cudaSetDevice(deviceId)
followed by your thrust code should work.
Just keep in mind that you will need to create and operate on separate vectors on each device (unless you have devices that support peer-to-peer memory access and PCI-express bandwidth is sufficient for your task).
Upvotes: 7