I have two questions about textures that I couldn’t answer with the guide:
- Are arrays of textures allowed? I tried this:
texture<float, 2, cudaReadModeElementType> tex_images[MAX_IMAGES];
…
tmp = texfetch(tex_images[n], x, y);
The declaration compiles fine, but on the fetch I get a compiler error that says “identifier “tex_images” is undefined.” It works fine if tex_images is not an array.
- Is there an elegant way to write into a texture from a kernel running on the device?
What I want to do here is take an arbitrary (not large, but not known a-priori) number of 2-D textures and do some operations on them in order to generate a resulting 2-D texture. Then I invoke a different kernel that does more operations on the result texture (that part seems to work fine).
Any help is appreciated!
Brian