【问题标题】:error : identifier “atomicExch” is undefined under visual studio 2012 and cuda 7.5错误:在 Visual Studio 2012 和 cuda 7.5 下未定义标识符“atomicExch”
【发布时间】:2016-02-15 09:26:30
【问题描述】:

我正在尝试使用 CUDA 7.5 SDK 在 Visual Studio 2012 下编译 CUDA 代码,但出现错误

“错误:标识符“atomicExch”未定义”。

所以我尝试从 CUDA SDK Samples 和一些论坛获取一些信息,但我仍然无法解决问题。

有什么建议或有人可以帮我解决这个问题吗?

【问题讨论】:

  • 发布您的代码...这里没有千里眼

标签: visual-studio-2012 cuda atomic


【解决方案1】:

好的,我终于通过在我的代码中添加以下内容来解决它:

// Compile kernel code for Compute 2.0 and above only

#if __CUDA_ARCH__ >= 200

    // Device funtions on the GPU

#endif

【讨论】:

  • 但是CUDA 7.5只支持compute 2.0及以上。无法使用该工具链编译计算 1.x 代码。
  • 我认为您将实际编译问题与智能感知错误混淆了。您显示的消息:“错误:标识符“atomicExch”未定义”,可能来自智能感知。如果您的代码的实际构建没有产生任何错误,您通常可以安全地忽略智能感知输出。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-10-21
  • 2016-12-04
  • 2013-07-27
  • 2018-11-13
  • 2018-06-30
相关资源
最近更新 更多