具有 Cuda Thrust 的多个 GPU?
如何将 Thrust 与多个 GPU 一起使用? 这只是使用 cudaSetDevice(deviceId) 的问题吗 然后运行相关的Thrust代码?
How do I use Thrust with multiple GPUs?
Is it simply a matter of using cudaSetDevice(deviceId)
and then running the relevant Thrust code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 CUDA 4.0 或更高版本,
cudaSetDevice(deviceId)
后跟您的推力代码应该可以工作。请记住,您需要在每个设备上创建和操作单独的向量(除非您的设备支持对等内存访问并且 PCI Express 带宽足以完成您的任务)。
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).