Image border issues

How does one deal with image borders when applying filter operations? Both convolutionSeperable and convolutionTexture seem to ignore the convolution kernel going over the image boundaries, why doesn’t this cause an access violation? Does CUDA just take care of this out of bounds access on its own?

With textures you can select whether you want zeros as a return or wrap around in your texture

What about with out textures? The convolutionSeperable sample isn’t using textures and it seems to ignore border cases.

Well, it’s an example, so it might be that they ignore it.

Check how the image data is allocated. For coalescing reasons, it may be padded to a multiple of 16 (or 32). If there is padding and the block size is chosen appropriately, the threads that are off the edge are just reading pixels from the padded area in memory.