covariance calculation of an image with cuda

hello, how can give me an idea how can i calculate the covariance of an image using cuda. thank you all in advance and have a nice day.