Hey, I am new to cuda! nvcc give an error in my code,
Compiler error mesg:
est.cu(8): error: can't generate code for non empty constructors or destructors on device
1 error detected in the compilation of "/tmp/tmpxft_0000055c_00000000-4_test.cpp1.ii".
Below is the simple code to reproduce the problem:
As far as I know textures cannot be part of complex data structures, because there is some magic to map them to the hardware. That also is why layered textures have been introduced to CUDA (to replace arrays of textures).
Another workaround would be to use function pointers for functions providing access to each texture used (or C++ subclasses, which are essentially the same).
Bindless textures on Kepler should enable one to embed texture handles in data structures (according to the whitepaper). Though, I don’t recall seeing them mentioned in the CUDA 4.2 guide, and the whitepaper says OpenGL only. Here’s hoping that CUDA-enable this feature in the next release.