本文介绍了编译包含动态并行的代码失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用CUDA 5.5和NVDIA GeForce GTX 780进行动态并行编程,计算能力为3.5。我调用内核函数内核函数,但它给我一个错误:
p>
解决方案
您可以这样做
nvcc -arch = sm_35 -rdc = true simple1.cu -o simple1 -lcudadevrt
如果您有两个文件simple1.cu和test.c,那么您可以执行以下操作。这称为单独编译。
nvcc -arch = sm_35 -dc simple1.cu
cuda编程指南
nvcc -arch = sm_35 -dlink simple1.o -o link.o -lcudadevrt
g ++ -c test.c
g ++ link.o simple1.o test.o -o simple -L / usr / local / cuda / lib64 / -lcudart
I am doing dynamic parallelism programming using CUDA 5.5 and an NVDIA GeForce GTX 780 whose compute capability is 3.5. I am calling a kernel function inside a kernel function but it is giving me an error:
What am I doing wrong?
解决方案You can do something like this
nvcc -arch=sm_35 -rdc=true simple1.cu -o simple1 -lcudadevrt
or
If you have 2 files simple1.cu and test.c then you can do something as below. This is called seperate compilation.
nvcc -arch=sm_35 -dc simple1.cu nvcc -arch=sm_35 -dlink simple1.o -o link.o -lcudadevrt g++ -c test.c g++ link.o simple1.o test.o -o simple -L/usr/local/cuda/lib64/ -lcudart
The same is explained in the cuda programming guide
这篇关于编译包含动态并行的代码失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!