在Windows上用qt写界面,需要用到cuda,windows上qt配置cuda花了很长时间,现在分享出来
windows上Qt Creator配置cuda与linux上大同小异
QT +=core TEMPLATE = app CONFIG += c++11 CONFIG -= app_bundle TARGET = simulation SOURCES += main.cpp HEADERS += algorithm.h
INCLUDEPATH +=D:\NVIDIA\testCuda\CUDA\v7.0\include \ D:\NVIDIA\testCuda\CUDA\v7.0\common\inc #Qt Creator配置路径不能包含空格,因此我把安装好的cuda新建了个文件夹
LIBS +=-LD:/NVIDIA/testCuda/CUDA/v7.0/lib/x64 \ -lcublas -lcublas_device -lcuda -lcudadevrt \ -lcudart -lopengl32 -lcudart_static -lcufft \ -lcufftw -lcurand -lcusolver -lcusparse
OTHER_FILES +=./algorithm.cu #要运行的程序
# Cuda sources
CUDA_SOURCES+=./algorithm.cu CUDA_SDK ="D:/NVIDIA/testCuda/CUDA/v7.0" CUDA_DIR ="D:/NVIDIA/testCuda/CUDA/v7.0" QMAKE_LIBDIR += $$CUDA_DIR/lib/x64 SYSTE