Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CUDA surfaces vs textures

Tags:

memory

cuda

What is the difference between a surface and texture object in CUDA? When should I use one or the other?

As far as I can tell from the developer documentation, they are exactly the same. Both appear to be CUDA arrays that use special texture memory. The only difference seems to be the API methods that access the memory.

like image 579
Azmisov Avatar asked May 23 '17 21:05

Azmisov


1 Answers

Textures are read-only, surfaces are writable and readable. The surface API was introduced later to accomodate for this difference.

Use textures for data that your kernels read only, surfaces if they also write to it.

like image 107
tera Avatar answered Nov 14 '22 19:11

tera