Advertisement
blackirishman

gemm test

Mar 23rd, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. static void gpuTest(){
  2.    
  3.     float matrix[9] = {1.057311, -0.204043, 0.055648, 0.041556, 1.875992, -0.969256, -0.498535,-1.537150, 3.240479};
  4.     Mat matrixMat = Mat(1, 9, CV_32FC1, matrix).t();
  5.     cv::gpu::GpuMat gpuMatrixMat;
  6.     gpuMatrixMat.upload(matrixMat);
  7.    
  8.     float matrixDest[9] = {1,1,1,1,1,1,1,1,1};
  9.     Mat matrixDestMat = Mat(9, 1, CV_32FC1, matrixDest).t();
  10.     cv::gpu::GpuMat destMatrixMat;
  11.     destMatrixMat.upload(matrixDestMat);
  12.  
  13.     cv::gpu::GpuMat nextMat;
  14.     cv::gpu::gemm(gpuMatrixMat, destMatrixMat, 1, cv::gpu::GpuMat(), 0, nextMat);
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement