码迷,mamicode.com
首页 > 其他好文 > 详细

matconv-GPU 编译问题

时间:2018-11-21 18:34:02      阅读:984      评论:0      收藏:0      [点我收藏+]

标签:inf   imp   app   ongl   \n   tla   users   define   ram   

如出现以下错误:

1 error detected in the compilation of "C:/Users/Justin/AppData/Local/Temp/tmpxft_00001afc_00000000-8_pooling_gpu.cpp1.ii".
pooling_gpu.cu
Error using vl_compilenn>nvcc_compile (line 521)
Command "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc" -c
"C:\Users\Justin\Documents\MATLAB\matconvnet-1.0-beta20\matlab\src\bits\impl\pooling_gpu.cu" -DNDEBUG -DENABLE_GPU -DENABLE_DOUBLE -D__SSSE3__
-gencode=arch=compute_61,code="sm_61,compute_61" -I"C:\Program Files\MATLAB\R2016a\extern\include" -I"C:\Program
Files\MATLAB\R2016a\toolbox\distcomp\gpu\extern\include" -gencode=arch=compute_61,code="sm_61,compute_61" -Xcompiler /MD -o
"C:\Users\Justin\Documents\MATLAB\matconvnet-1.0-beta20\matlab\mex.build\bits\impl\pooling_gpu.obj" failed.

Error in vl_compilenn (line 466)
nvcc_compile(opts, srcs{i}, objfile, flags.nvcc) ;

 

 

则要修改上面错误中红色字体的.cu文件

技术分享图片

在163行的函数用下面替换

// an implementation of atomicAdd() for double (really slow)
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 600
#else
__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;
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

 

 

matconv-GPU 编译问题

标签:inf   imp   app   ongl   \n   tla   users   define   ram   

原文地址:https://www.cnblogs.com/burton/p/9996744.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!