covariance library

I am newbie for CUDA, so please forgive me for asking simple question.

Is there any library with its built-in function can be used to calculate covariance between vectors or matrices?

I am trying to measure the similarity between 3 images. I know cuFFT library can be used to calculate cross-correlation, but I am not sure whether and how it is used to calculate covariance.