matrix multiply for openCL and CUDA