Items with no label
3335 Discussions

CUDA with RealSense SDK2.0

idata
Employee
1,750 Views

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,

0 Kudos
5 Replies
MartyG
Honored Contributor III
400 Views

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.

0 Kudos
idata
Employee
400 Views

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.

0 Kudos
MartyG
Honored Contributor III
400 Views

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.

0 Kudos
idata
Employee
400 Views

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,

0 Kudos
MartyG
Honored Contributor III
400 Views

Thanks for the update, TK!

0 Kudos
Reply