Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Using CUDA Library in Qt Project

Using CUDA Library in Qt Project

Scheduled Pinned Locked Moved Installation and Deployment
3 Posts 2 Posters 15.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pmwalk
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hpollak
      wrote on last edited by
      #2

      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 :-)

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pmwalk
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved