Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Texture memory with READ and WRITE

Tags:

cuda

I'm developing one CUDA app where kernel has to go to global memory many times. This memory is accessed by all CTAs randomly (no locality, so cannot use shared memory). I need to optimize it. I heard that texture memory can alleviate this problem but can kernel read and write into texture memory? 1D texture memory? 2D texture memory? Also what about CUDA arrays?

like image 431
username_4567 Avatar asked Dec 04 '22 02:12

username_4567


1 Answers

CUDA Textures are read only. Texture reads are cached. So performance gain is probabilistic.

CUDA Toolkit 3.1 onwards also have writeable textures known as Surfaces, but they are available only for devices with Compute Capability >=2.0. Surfaces are just like textures but the advantage is that they can also be written by the kernel.

Surfaces can only be bound to cudaArray created with flag cudaArraySurfaceLoadStore.

like image 92
sgarizvi Avatar answered Dec 11 '22 09:12

sgarizvi