Function:MatMul

From CUVI Wiki
Jump to: navigation, search

Performs matrix multiplication

Function

CuviStatus matMul(const CuviImage& A,
                  const CuviImage& B,
                  CuviImage& C,
                  const CuviStream& stream = CuviStream());

Parameters

Name Type Description
A CuviImage& First Input Image
B CuviImage& Second Input Image
C CuviImage& Resultant Image
stream CuviStream& GPU stream ID for execution

Image Type Support

Input 1 Input 2 Output
32fc1 32fc1 32fc1

Example

CuviSize aSize(3,3);
CuviSize bSize(3,3);
 
//Initialize images
CuviImage A(aSize, CUVI_32FC1);
CuviImage B(bSize, CUVI_32FC1);
 
//Fill images with random values
cuvi::dataExchange::generateRandomImage(A);
cuvi::dataExchange::generateRandomImage(B);
 
 
CuviImage C;
 
//Perform matrix multiplication
cuvi::arithmeticLogical::matMul(A,B,C);