Using CUDA Library in Qt Project
-
wrote on 6 Feb 2014, 03:53 last edited by
Hello all,
I'm trying to get a simple Qt Widget project to use a CUDA library that I've compiled. I've added the following to the .pro file:
@LIBS += -L$$PWD/ -lCUDA_lib
INCLUDEPATH += $$PWD/
DEPENDPATH += $$PWD/@The library consists of the basic CUDA VS2012 template (just a kernel.cu file implementing array addition), but when I call the function to start this:
@int a [5] = {1, 2, 3, 4, 5};
int b [5] = {6, 7, 8, 9, 10};
int c [5] = {};
addWithCuda(c, a, b, 5);@I get a "C3861: 'addWithCuda': identifier not found" error.
I assume I have to use a header file here, but I am unsure how. I have the .lib file copied to the Qt project's base directory, but should I instead reference the original in the .pro file?
Any help would be greatly appreciated. Thanks.
Phillip
-
wrote on 6 Feb 2014, 08:52 last edited by
See
"Article":http://cudaspace.wordpress.com/2012/07/05/qt-creator-cuda-linux-review/."Article":http://stackoverflow.com/questions/12266264/compiling-cuda-code-in-qt-creator-on-windows
I think this should help you :-)
-
wrote on 6 Feb 2014, 21:23 last edited by
Thanks for the links!
I'd actually previously found both of those however (I'm doing this on Windows, so the second was more for me), and neither of those methods worked :-(. One mentioned to be sure to run qmake whenever you change the .pro file... I assume building the project in Qt Creator does this, or do I need to run qmake separately if I only change the .pro file?
In any event, I do have a dual book Windows/Ubuntu set up, so maybe I'll have better luck if I try all of this on the Linux side. I'll give it a shot.
3/3