Is it possible to use STL classes from host functions or to even #include an STL file in an nvcc-compiled source file?
The following cuda code generates all kinds of compiler errors:
#include <vector>
void test(void)
{
;
}
errors:
Compiling...
"C:\Program Files\Microsoft Visual Studio 8\VC\include\yvals.h", line 580: error:
identifier "__thiscall" is undefined
explicit __thiscall _Lockit(); // set default lock
...
"C:\Program Files\Microsoft Visual Studio 8\VC\include\yvals.h", line 731: error:
member function with the same name as its class must be a constructor
__thiscall _Mutex();
... etc
As the manual says, nvopencc is a C compiler. C++ stuff like templates, exceptions, etc will not work.
However, as you can see with nvcc -v there is quite a bit of preprocessing going on using cl or gcc. So you can use C++ constructs that can be resolved all the way down to pure C functions in the preprocessing. An example is the functions templates used in the CUDA includes and SDK examples.