Alex.Brown
Alex.Brown

Reputation: 53

What's the difference between global memory and texture in CUDA?

What's the difference between global memory and texture in CUDA? To speed up memory copying from host to device, which one is better? I am going to use them for Image Processing. I've seen the sample for bilateral filtering. It used texture instead of global memory.

I'd like some to explain about it. Thanks.

Upvotes: 3

Views: 1289

Answers (1)

brano
brano

Reputation: 2870

Texture memory is referred to a hardware unit that maps onto global memory.
Performing copy between host memory and GPU memory is always done with global memory involved it does not matter if a texture unit is mapped onto that piece of global memory or not.

You can read more about texture memory in CUDA programming guide

Bilateral filtering Sample uses texture unit to increase memory throughput by utilizing Texture unit caching mechanism.

Benefits of using texture memory:

  • Enables caching of global memory
  • Capability of caching data to maximize 2D spacial locality
  • Linear interpolation in hardware
  • Handling out-of-bounds addresses in hardware

Upvotes: 2

Related Questions