Some questions about texture from pitchlinear memory..

  1. This kind of textures are cached? i.e have the benefits of standard texture memory and can be used as cached read-only global device mem…

  2. Assuming it’s cached, how and when to expect that the cache is cleared or updated and consistent with the modified values? I suspect that situation similar to global synchronization that needs kernel finalization and these updates get “usable” in the next kernel invocation… then I assume that one kernel can’t read and write the same positions of memory because of issues with the cache… Also I suspect that from OpenCL spec:
    “OpenCL 1.0 supports 2D image memory objects that can be read or written by kernels. Reads and writes to the same 2D image memory object are not supported in a kernel”.

  3. I think that this type of “write textures” are only 2D currently and not 3D write textures are exposed… It’s currenty a hardware limitation or it’s just that’s it’s not exposed in CUDA 2.2.


The programming guide states that “texture memory” is cached, so the use of the texture fetch to read from pitchlinear memory does imply that it is cached. Although a simple microbenchmark should confirm this.

The same as with all the other uses of the texture cache on the GPU. You must allow the kernel to finish before you are guaranteed that you will read the updated values from memory.

Check the programming guide: CUDA currently doesn’t support any way of writing to CUDA Arrays. But CUDA Arrays are only needed for textures when you want coordinate wrapping or linear interpolation

You can write to global memory that is arranged in 1D, 2D, or 3D fashion and bind that memory to textures (though, indexing the 3D textures with a 2D or 1D texture read would have to be done by hand).

I don’t know how this relates to OpenCL. I haven’t had a chance to play with the beta yet.