Given the matrices *A1,...,An* and *B1,...,Bn* stored as `gpuArray`, I want to calculate the matrices *Ci=Ai\*Bi*.

All *Ai*'s are of the same size, and all *Bi*'s are of the same (possibly different) size.

How do I do this fast on the GPU, assuming that *n* is very large and the sizes of the matrices are relatively small? Is it possible to avoid using CUDA?