Handling Edge Tiles
Bounds and padding at array borders.
The Boundary Problem
Real arrays rarely divide evenly into tiles. The last tile at each border may run off the end of your data.
Out-of-Range Reads
A thread whose global index exceeds the array size will read garbage or crash. Edge tiles must guard every access.