cuda编译总结

 
Device code linking

nvcc –arch=sm_20 –dlink v3.o particle.o main.o –o gpuCode.o

将所有的device object code链接到gpuCode,o中,不链接cpu object code。

g++ gpuCode.o main.o particle.o v3.o –lcudart –o app

将剩余CPU object code链接进来,形成可执行文件
-x可以使得nvcc 将.cpp文件视为.cu文件

Leave a Reply

Your email address will not be published. Required fields are marked *