QT + CUDA setting qmake.pro file

≯℡__Kan透↙ 提交于 2019-12-14 03:57:41

问题


I'm trying to do a simple Qt + Cuda framework with an Helloworld.cu example. It is the simplest Qt ever. I'm trying to create the project file using a .pro file. My setup is windows 7, Qt 4.7.4 and Cuda toolkit + SDK (last version). Everything for Qt is working. What is not working is the Cuda part of the code, and that's probably because there is something missing in the .pro file...is there a simple paste/copy i could use for cuda in my .pro file? thanks


回答1:


Take a look at http://cudaspace.wordpress.com/2011/04/07/qt-creator-cuda-linux/

You must adjust

# Path to cuda SDK install
CUDA_SDK = /pathto/NVIDIA_GPU_Computing_SDK/C (note i'm using a linux machine)
# Path to cuda toolkit install
CUDA_DIR = /usr/local/cuda

# libs - note than i'm using a x_86_64 machine
LIBS += -lcudart -lcutil_x86_64

with your CUDA SDK, CUDA Toolkit directories under windows and the name of the LIBS.

Maybe you will need to adjust the architecture m32 or m64 for 32 and 64 bits.

Hope this help.



来源:https://stackoverflow.com/questions/7800093/qt-cuda-setting-qmake-pro-file

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