在CUDA统一内存多GPU或多处理器中使用原子算术运算 [英] Using atomic arithmetic operations in CUDA Unified Memory multi-GPU or multi-processor
本文介绍了在CUDA统一内存多GPU或多处理器中使用原子算术运算的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试实现使用统一内存的CUDA程序.我有两个统一的数组,有时它们需要原子更新.
I am trying to implement a CUDA program that uses Unified Memory. I have two unified arrays and sometimes they need to be updated atomically.
以下问题为单个GPU环境提供了答案,但我不确定如何扩展问题中给出的答案以适应多GPU平台.
The question below has an answer for a single GPU environment but I am not sure how to extend the answer given in the question to adapt in multi-GPU platforms.
如果您需要此信息,我有4辆Tesla K20,它们全部更新了必须原子完成的部分阵列.
I have 4 Tesla K20 if you need this information and all of them updates a part of those arrays that must be done atomically.
我将不胜感激.
推荐答案
将评论汇总为答案:
- 您可以使用
atomicAdd_system
执行这种在地址空间范围内的原子操作 - 但是,您只能在计算能力6.x或更高版本的设备(如果使用Tegra,则为7.2或更高版本)上执行此操作
- 具体来说,这意味着您必须编译以获得正确的计算能力,例如
-arch = sm_60
或类似的 - 您在问题中指出您正在使用Telsa K20卡-这些是计算能力3.5,不支持任何系统范围的原子功能.
As always, this information is neatly summarized in the relevant section of the Programming Guide.
这篇关于在CUDA统一内存多GPU或多处理器中使用原子算术运算的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文