cuda thrust lambda报错

1.确保:

项目 属性-> 配置属性 -> CUDA C/C++ -> Common "Target Machine Platform" 与 平台“x32/x64”保持一致

2 XX.cu 的 属性-> 配置属性 -> CUDA C/C++ -> Common Line 其它选项 添加

编译可行

“--extended-lambda ”

严重性代码说明项目文件行禁止显示状态

错误The closure type for a lambda ("lambda [](int, int)->__nv_bool", defined at D:\Learn\integrationProj\UnionProj\CudaRuntimeTest\cuMain.cu:28) cannot be used in the template argument type of a __global__ function template instantiation, unless the lambda is defined within a __device__ or __global__ function, or the flag '-extended-lambda' is specified and the lambda is an extended lambda (a __device__ or __host__ __device__ lambda defined within a __host__ or __host__ __device__ function)CudaRuntimeTestC:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include\thrust\system\cuda\detail\core\agent_launcher.h983

严重性代码说明项目文件行禁止显示状态

错误MSB3721命令“"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_52,compute_52\" --use-local-env -ccbin "D:\Program Files\VisualStudio2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64" -x cu -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6\include" -G --keep-dir x64\Debug -maxrregcount=0 --machine 64 --compile -cudart static extended-lambda -g -D_DEBUG -D_CONSOLE -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /Od /Fdx64\Debug\vc142.pdb /FS /Zi /RTC1 /MTd " -o x64\Debug\cuMain.cu.obj "D:\Learn\integrationProj\UnionProj\CudaRuntimeTest\cuMain.cu"”已退出,返回代码为 1。CudaRuntimeTestD:\Program Files\VisualStudio2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations\CUDA 11.6.targets790

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值