Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Converting CUDA code to a DLL equivalent to use in MFC

Converting CUDA code to a DLL equivalent to use in MFC

Scheduled Pinned Locked Moved C / C++ / MFC
c++visual-studiohelpquestion
6 Posts 2 Posters 0 Views 1 Watching
  • 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.
  • K Offline
    K Offline
    Kiran Satish
    wrote on last edited by
    #1

    Hello, I have some CUDA code in .cu file that I add to my solution (MFC project in VS 2008) as a source file and it all works fine. Now I would like to access the same functions that I defined in .cu file in my application via a DLL equivalent of that .cu file so that I can keep the soruce code away from users. Could someone help me out with this? I already tried on nvidia forums, but didn't get any reply. thanks in advance.

    PKNT

    A 1 Reply Last reply
    0
    • K Kiran Satish

      Hello, I have some CUDA code in .cu file that I add to my solution (MFC project in VS 2008) as a source file and it all works fine. Now I would like to access the same functions that I defined in .cu file in my application via a DLL equivalent of that .cu file so that I can keep the soruce code away from users. Could someone help me out with this? I already tried on nvidia forums, but didn't get any reply. thanks in advance.

      PKNT

      A Offline
      A Offline
      Albert Holguin
      wrote on last edited by
      #2

      Well, I'm not familiar with cuda but as to what you're trying to achieve, you'll just have to create a DLL with some set of exports and a corresponding header file(s) that will allow users to pull that functionality off the dll. There should be plenty of resources online on the subject: http://msdn.microsoft.com/en-us/library/ms235636.aspx[^] HowTo: Export C++ classes from a DLL[^]

      K 1 Reply Last reply
      0
      • A Albert Holguin

        Well, I'm not familiar with cuda but as to what you're trying to achieve, you'll just have to create a DLL with some set of exports and a corresponding header file(s) that will allow users to pull that functionality off the dll. There should be plenty of resources online on the subject: http://msdn.microsoft.com/en-us/library/ms235636.aspx[^] HowTo: Export C++ classes from a DLL[^]

        K Offline
        K Offline
        Kiran Satish
        wrote on last edited by
        #3

        I am aware of writing DLLs in C++ and I have written many before. I started out in the same way and stumbled upon errors specific to cuda header files that are included in the project. Specifically syntax missing error for the lines

        texture texDataIn;
        texture texDataMid;
        texture texDataOut;

        PKNT

        A 1 Reply Last reply
        0
        • K Kiran Satish

          I am aware of writing DLLs in C++ and I have written many before. I started out in the same way and stumbled upon errors specific to cuda header files that are included in the project. Specifically syntax missing error for the lines

          texture texDataIn;
          texture texDataMid;
          texture texDataOut;

          PKNT

          A Offline
          A Offline
          Albert Holguin
          wrote on last edited by
          #4

          what's the error?

          K 1 Reply Last reply
          0
          • A Albert Holguin

            what's the error?

            K Offline
            K Offline
            Kiran Satish
            wrote on last edited by
            #5

            For all those 3 lines, the error log shows

            1>error C2143: syntax error : missing ';' before '<'
            1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
            1>error C2143: syntax error : missing ';' before '<'
            1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
            1>error C2086: 'int texture' : redefinition
            1>see declaration of 'texture'
            1>error C2143: syntax error : missing ';' before '<'
            1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
            1>error C2086: 'int texture' : redefinition
            1>see declaration of 'texture'

            thanks

            PKNT

            A 1 Reply Last reply
            0
            • K Kiran Satish

              For all those 3 lines, the error log shows

              1>error C2143: syntax error : missing ';' before '<'
              1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
              1>error C2143: syntax error : missing ';' before '<'
              1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
              1>error C2086: 'int texture' : redefinition
              1>see declaration of 'texture'
              1>error C2143: syntax error : missing ';' before '<'
              1>error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
              1>error C2086: 'int texture' : redefinition
              1>see declaration of 'texture'

              thanks

              PKNT

              A Offline
              A Offline
              Albert Holguin
              wrote on last edited by
              #6

              That first error essentially says that the texture<> template is undefined. Make sure you have the appropriate header included.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups