error: function "atomicAdd(double *, double)" has already been defined
来源:互联网 发布:mac双系统开机默认 编辑:程序博客网 时间:2024/04/30 10:10
在编译deeplab_V2的时候,用Cuda-8.0,出现上述错误。
之前在cuda-7.5的时候,没有出现这个错误。在网上找到错误的原因,记录下来。
原文地址
CUDA 8.0 provides a definition of atomicAdd on double quantities that was not present in previous CUDA toolkits. The code you are working with also apparently provides its own definition/implementation, and this is the source of the error message. The correct fix is to make source code changes to the software in question to make it compatible with CUDA 8.
I had to modify the file common.cuh from the DeepLab_v2 master branch in the following way:
#ifndef CAFFE_COMMON_CUH_#define CAFFE_COMMON_CUH_#include <cuda.h> #if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600 #else static __inline__ __device__ double atomicAdd(double *address, double val) { unsigned long long int* address_as_ull = (unsigned long long int*)address; unsigned long long int old = *address_as_ull, assumed; if (val==0.0) return __longlong_as_double(old); do { assumed = old; old = atomicCAS(address_as_ull, assumed, __double_as_longlong(val +__longlong_as_double(assumed))); } while (assumed != old); return __longlong_as_double(old); } #endif#endif
阅读全文
0 0
- error: function "atomicAdd(double *, double)" has already been defined
- 编译cuda源程序时出错 error: function “atomicAdd(double *, double)” has already been defined
- error: function "atomicAdd(double *, double)" has already been defined错误解决方法
- caffe/common.cu error: function atomicadd has already been defined
- error: Attribute "buttonBarStyle" has already been defined
- 引用工程时 error: Attribute "color" has already been defined
- Error:(2) Attribute "titleTextColor" has already been defined
- Attribute "XXX" has already been defined
- Attribute "XXX" has already been defined
- Attribute "roundWidth" has already been defined
- error:Fingerprint has already been taken
- Attribute "xxx" has already been defined
- Android 问题:Attribute "xxx" has already been defined
- Attribute "title" has already been defined 异常解决
- 解决Attribute "rippleColor" has already been defined的问题
- Android SlidingMenu导入ActionBar,Attribute "xxx" has already been defined
- 完美解决 Attribute “titleTextStyle” has already been defined
- fatal error C1189: #error : WinSock.h has already been included
- java--xml解析
- ITU标准系列图书表单
- [leetcode]151. Reverse Words in a String
- 程序的机器级表示(一)(关于程序员,这些汇编知识就够了)
- 多个字段查重
- error: function "atomicAdd(double *, double)" has already been defined
- 一款最新发布的刷网站流量软件
- 操作系统中的各个关系
- Spark性能优化
- 利用R语言分析挖掘Titanic数据集(一)
- Session是否过期失效
- python flask web环境配置步骤
- mysql触发器
- 计数排序