cuda中dynamic parallelism中遇到的链接错误:error LNK2001: unresolved external symbol ___fatbinwrap_66_tmpxft_…

cuda从5.0版本之后开始支持dynamic parallelism,即可以在__global__函数中调用其他global函数,因此可以实现核函数中再调用核函数。

dynamic parallelism(动态并行)的软硬件条件有:

1. cuda toolKit 版本5.0或以上;

2. GPU compute capability(计算能力)3.5及以上。


此时就可以在核函数中调用另一个核函数了,也可以实现递归调用。

另外会有两个问题:

      1、1227 error : kernel launch from __device__ or __global__ functions requires separate compilation mode

            这是需要开启 generation of relocatable device code ,即在配置属性中设置-rdc=true

      2、出现如下link error:

      无法解析的外部符号 ___fatbinwrap_66_tmpxft_0000176c_00000000_16_cuda_device_runtime_compute_70_cpp1_ii_8b1a5d37,该符号在函数 ___cudaRegisterLinkedBinary_66_tmpxft_0000176c_00000000_16_cuda_device_runtime_compute_70_cpp1_ii_8b1a5d37 中被引用

扫描二维码关注公众号,回复: 1108785 查看本文章

      这是因为动态并行还需要附加另一个库:cudadevrt.lib。加入即可。

猜你喜欢

转载自blog.csdn.net/a812073479/article/details/80259196