If you are asking “where is this information located?” just google TRSF_READ_AS_INTEGER Then read the top 5 or 10 hits.
If you are asking “how would I have found this information had I not known what to look for?” I don’t know if I have a good answer to that. I didn’t find it by simply reading pycuda documentation or studying pycuda codes.
For starters, if you want to solve problems like this, it probably helps to have a rock-solid understanding of how textures work in CUDA C++, and what are all the knobs for. That is documented to a considerable degree in the CUDA C++ programming guide.
In addition, there are various (CUDA C++) sample codes provided to demonstrate texturing. None of these are in python of course. So being an expert in CUDA C++, as well as having worked with some texture codes in detail would probably help but certainly doesn’t carry you over the finish line.
pycuda is an adapter/layer on top of the CUDA driver API, so as to provide effectively a python host wrapper for GPU activity (where such activity is still launched in the form of CUDA C++ kernels). pycuda was not written by NVIDIA. It’s not officially part of the CUDA toolkit, nor is it officially supported or maintained by anyone at NVIDIA. So google is your friend, and you have to have a thought process that leads to a solution, of course.
I’m pretty knowledgeable in CUDA C++. Less so with textures. Less so with pycuda.
My thought process was this:
- I know this is possible in CUDA C++
- I’ll bet dollars to donuts it’s doable in pycuda. (pycuda is a high-quality implementation, in my opinion)
- google google google google, huh. Nothing.
- OK, lets start playing with every imaginable documented knob in pycuda that pertains to texturing.
- after trying 5 or 6 things, “voila!”
Step 4 is where the CUDA C++ texturing knowledge helps. Otherwise you’re stabbing in the dark.
It’s not pretty. It requires a functional knowledge of pycuda, textures, and CUDA. A working test setup. And persistence. And perhaps luck.
But that’s programming, in my view.
PS, had you not decided to come back and post a complete example, I wouldn’t have bothered with this.