I’m looking to have a CPP wrapper to deal with textures in cuda that only needs to know the name of the texture in the *.cu kernel file. It seems that if I know the name of the texture the function “cudaGetTextureReference” should allow me to get a pointer to the textureReference…which I would then be able to modify/bind/unbind etc.
In my constructor I pass in the texture name, a char* named symbol.
The following line gives me problems:
textureReference* m_texReference; CUDA_SAFE_CALL( cudaGetTextureReference(&m_texReference, symbol));
I get the following error:
I would like to later do things like
Someone posted in October they thought it was a mistake in the cuda_runtime_api.h
but that stance appeared to be contested.
I thought I would raise the topic again here and see what you all think or if you have any ideas for ways to work around it.
**Note: This extends the work of a generalized C++ wrapper library I found at
If all goes well, I post my extended version here.