cudaBindTexture trouble in 0.9


When trying to convert my project to work with version 0.9 of CUDA I have run into problems. It seems wherever I try to use the cudaBindTexture method, it fails to compile. I finally tried putting the following into the simpleTexture sample (which otherwise works fine):

float *devptr; 

	cudaMalloc((void **)&devptr, 256); 

	texture<float, 2, cudaReadModeElementType> texRef;

	cudaBindTexture(texRef, devptr, 256, 0);

And then it fails to compile:

Looking through the sample code I can’t find a single reference to cudaBindTexture (just cudaBindTextureToArray). What am I doing wrong? It worked fine in 0.8. Thanks for any help,

I have been having similar troubles. It looks like not a single one of the examples uses linear memory bound to a texture…so no help with examples there (maybe there should be one…). I have also tried using the “low-level API” version of the cudaBindTexture function to no avail.

Oh, good. It’s not just me then ;). So I’m guessing this is either a bug of the compiler or an undocummented new feature. NVIDIA folks, any ideas? I’d really like to start taking advantage of asyncronous kernels.

There is an error in the documentation you need to use the following function call:

cudaBindTexture(0, texRef, devPtr, size);

The 4th argument in the documentation is actually the first argument in the actual implementation.

The error is on the bottom of page 32 in the programming manual.