Reputation: 125
is there a way to use inside global kernel:
1) Simple structures like:
Structure Pixel{
float p;
}
2) Classes with functions and overloaded operators (C++)
3) std:: vector?
Thanks
Upvotes: 0
Views: 815
Reputation: 152164
In general, C++ support is spelled out in the programming guide:
For the host code, nvcc supports whatever part of the C++ ISO/IEC 14882:2003 specification the host c++ compiler supports.
For the device code, nvcc supports the features illustrated in Code Samples with some restrictions described in Restrictions; it does not support run time type information (RTTI), exception handling, and the C++ Standard Library.
There are many CUDA sample codes that demonstrate various C++ support/features, including overloading.
Thrust is a template library that allows usage of (thrust) vector containers with various forms of parallelization (including GPU acceleration). Users of STL vector containers and algorithms will find thrust constructs familiar. The quick start guide may be of interest.
Upvotes: 4