Best way to handle boundaries and boundary conditions - are textures the right way to go?

I’m doing some experiments with convolutions and was wondering if textures are really the way to go for handling boundary conditions.

When loading data into shared memory, or for direct handling, there is an issue with what to do with pixels that are outside the boundaries of the image.

The three ways to do it is either:
a. Allocate extra boundary pixels or use just an internal block in the image
b. Do the logic in the kernel for duplicating pixels
c. use textures

(a) causes miss-aligned writes, unless I’m missing some trick
(b) costs a lot of time to do the logic and it’s pretty complicated
© textures make accounting much easier as they do boundary handling in hardware which means that they are faster and easier than (b) and solve missaligned writes in (a), but are horrible for proper object oriented and multi thread approaches as they are global creatures, and have a limited throughput.

Is there a better solution than the above three or am I missing something regarding any of them?

Thanks

I’m doing some experiments with convolutions and was wondering if textures are really the way to go for handling boundary conditions.

When loading data into shared memory, or for direct handling, there is an issue with what to do with pixels that are outside the boundaries of the image.

The three ways to do it is either:
a. Allocate extra boundary pixels or use just an internal block in the image
b. Do the logic in the kernel for duplicating pixels
c. use textures

(a) causes miss-aligned writes, unless I’m missing some trick
(b) costs a lot of time to do the logic and it’s pretty complicated
© textures make accounting much easier as they do boundary handling in hardware which means that they are faster and easier than (b) and solve missaligned writes in (a), but are horrible for proper object oriented and multi thread approaches as they are global creatures, and have a limited throughput.

Is there a better solution than the above three or am I missing something regarding any of them?

Thanks