5 Replies Latest reply on Jun 10, 2018 11:56 PM by MartyG

    CUDA with RealSense SDK2.0

    tk_eab

      Hello,

       

      I'm trying to replace align.cpp and align.h with align.cu and align.cuh, respectively for using CUDA. I have not made any change in their source codes -- just the name of files. I could activate the CUDA option on CMake. When building realsense2.dll on Visual Studio 2015, however, it gives me errors such as the following ones:

       

      C2039   'HostingClass': "global namespace" is not a member .

      C2433   'librealsense:HostingClass': 'friend' cannot be use to declare data.

       

      The problem seem either that the align.cu and align.cuh are not compiled correctly or that these files are not linked to other C++ files correctly. Can anyone guess what changes I need to make?

       

      Regards,

        • 1. Re: CUDA with RealSense SDK2.0
          MartyG

          The potential for errors when changing filenames is very high, as you have to make sure that absolutely every reference to the previous filename is changed.  I have found in Visual Studio that mass-changing filenames automatically using Find and Replace All can cause a big mess in the code.  It works better if you just Find In File so that a list of all the references appears in a list at the bottom of the Visual Studio window, and then click on and edit each reference in the list individually.

           

          In regard to general advice when using SDK 2.0 with ARM:  It may help if you are using the most recent version of SDK 2.0 (currently 2.12.0).  A few versions back in version 2.11.0, a bug-fix for compiling on ARM was added.

          • 2. Re: CUDA with RealSense SDK2.0
            tk_eab

            Thanks MartyG. Following your advice, I used File in Files but the change in file names was not an issue -- I still got the same set of errors. Thanks anyway.

            • 3. Re: CUDA with RealSense SDK2.0
              MartyG

              I wonder if Visual Studio's project linkages were broken by changing the filenames.  You could perhaps link to the new filenames   I gave someone some advice on this recently.

               

              Re: First contact with D415 ,What should I do

              • 4. Re: CUDA with RealSense SDK2.0
                tk_eab

                MartyG

                 

                Thanks. I just changed the file name from align.cpp to alignM.cpp as well as from aligh.h to alignM.h. After changing #include "align.h" to #include "alignM.h" in align.cpp and rs.cpp, I succeeded in building the SDK on Visual Studio. So, the issue I mentioned earlier seems to come from other factors.

                 

                I asked a similar question on a CUDA forum and will see if anyone gives me some advice.

                 

                Regards,

                • 5. Re: CUDA with RealSense SDK2.0
                  MartyG

                  Thanks for the update, TK!