Your answer seems to be very good, but I am not really aware of what all you are describing up there, as I program mainly on matlab, and I have good knowledge about C programming, What I need is a code help, I think the kernel function prototype would be: __global__ void ApplyAverageFilter( int **Image, int **Result, int filterSize ); , I need help with the code.