Creating DLL from CUDA using nvcc

给你一囗甜甜゛ 提交于 2019-11-30 22:30:05

Solved. I still don't know why happened (maybe it is because of not using official compiler like Robert Crovella said), but replacing the two commands for making a DLL by this one works:

nvcc -o kernel.dll --shared kernel.cu

Note the double dash (nvcc works this way), and the fact of making it directly instead of creating first .o and then making DLL from the object.

In visual studio you can also make it compile into a .dll instead of a .obj file by navigating through the options:

DEBUG -> -Project name- Properties -> Configuration properties -> Configuration Type

Change the option from Application(.exe) to Dynamic Library(.dll)

You can find the dll after compiling in the DEBUG folder or RELEASE folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!