I get weird compile errors if I try to introduce any sort of C++ into my CUDA code.
I just included with NOTHING ELSE and it gave a compile error there.
If I include any special keyworded variables (such as device float *array) in namespaces or classes
I get compile errors. If I have them inside of namespaces, more errors arise (such as error C2065: ‘__shadow__ZN6s3cuda10output_devE’ : undeclared identifier). However, I use a CUDA class to wrap all my functionalty.
Basically what I’m doing now is I have all GPU specific variables/kernel code as globals outside of the class and namespace spaces, which are then called and used inside of the classes. However, I am going to be threading this app so I need an instace of these PER CLASS, so I need them inside of the class as local variables - is it possible?
Care to share which operating system and compiler version you are using? [my guess is gcc and in that case you need to do a little reading about the g++ obj/template instantiation model].
Windows XP Service Pack 3 with Visual C++ 05 express. The project was created using the CUDA project wizard found on these forums. It might be useful to note that I am building it as a .LIB, to be linked in from another C++ program.
ON A SIDE NOTE: If I just include to my working program, I get a crash of cudafe++.exe, and the following error gets spewed out: internal error: assertion failed: gen_expr: bad expr node kind (D:/Bld/rel/gpgpu/toolkit/r2.1/compiler/edg/EDG_3.9/src/cp_gen_be.c, line 9510)