QT + CUDA设置qmake.pro文件 [英] QT + CUDA setting qmake.pro file
问题描述
我正在尝试使用Helloworld.cu示例创建一个简单的Qt + Cuda框架.这是有史以来最简单的Qt.我正在尝试使用.pro文件创建项目文件.我的设置是Windows 7,Qt 4.7.4和Cuda工具包+ SDK(最新版本).Qt的所有功能都可以正常工作.代码的Cuda部分无法正常工作,那可能是因为.pro文件中缺少某些内容...在我的.pro文件中是否可以将简单的粘贴/副本用于cuda吗?谢谢
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
推荐答案
看看您必须调整
# 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
使用您的CUDA SDK,Windows下的CUDA Toolkit目录以及LIBS的名称.
with your CUDA SDK, CUDA Toolkit directories under windows and the name of the LIBS.
也许您需要针对32位和64位调整m32或m64体系结构.
Maybe you will need to adjust the architecture m32 or m64 for 32 and 64 bits.
希望获得帮助.
这篇关于QT + CUDA设置qmake.pro文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!