Using Multiple Texture Units Possibility of using multiple texture units in CUDA?


I use the driver API with cuParamSetTexRef, which takes a parameter ‘texunit’. In the current release (CUDA3.1) this texunit value HAS to be CU_PARAM_TR_DEFAULT, but the existence of this parameter suggests that in a future release, multiple texture units may be available.

It certainly would be useful in some imaging algorithms to be able to bind multiple texture units, thus enabling multiple images to be fetched with tex2D in this way and facilitating warping/interpolation/blending or other manipulation of two or more images simultaneously.

Is anybody at NVidia or elsewhere able to shed some light on if use of multiple texture units will be available in future releases of CUDA? It would be a ‘nice to have’ feature.


Jason Dale

In high-level Cuda, having multiple textures references bound is no problem(I have one kernel which reads from about 8 textures with different sizes/datatypes).

I guess the texunit parameter of the driver API is for performance tuning but currently unsupported(not sure though).

Thanks for the reply Nighthawk. Thats really interesting since as I understand it, the Runtime API is built on the Driver API, so it must be possible. Just knowing that means I will try a few things with the DriverAPI. I will see if I can make multiple calls to cuParamSetTexRef using the default texture unit and then if the kernel can address the different textures, and despite the documentation, will try using different values for ‘texunit’ too.

Thanks for the pointer Nighthawk - I have tried calling cuParamSetTexRef multiple times with different texture references, using the default texture unit (CU_PARAM_TR_DEFAULT) and this seems to work fine. Makes me wonder what the ‘texunit’ parameter is or once was actually intended for…