2
votes

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.

1
I think you meant "bilinear" interpolation, not "bilateral"?njuffa
@njuffa: There are both bilinear filter and bilateral filter. Bilinear filter use Bilinear interpolation and bilateral filter is a non-linear filter.brano
Bilateral Filter is a filter that removes noises from an Image. It is widely used Filter but time consuming algorithm. But I can see some CUDA samples including Bilateral Filter. What I want to know is the benefit of using Texture instead of global Memory.Alex.Brown

1 Answers

2
votes

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