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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With