Difference between revisions of "Function:MatMulTrans"

From CUVI Wiki
(Created page with "__NOTOC__ Performs matrix multiplication with its transpose. ===Function=== {| |style="font-size:150%;"| <syntaxhighlight lang="cpp"> CuviStatus matMulTrans(const CuviImage& ...")
 
Line 56: Line 56:


CuviSize aSize(3,3);
CuviSize aSize(3,3);
CuviSize bSize(3,3);


//Initialize input image
//Initialize input image

Revision as of 15:29, 13 June 2014

Performs matrix multiplication with its transpose.

Function

CuviStatus matMulTrans(const CuviImage& A,
                       CuviImage& B,
                       bool trans = false,
                       const CuviStream& stream = CuviStream());

Parameters

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

Image Type Support

Input 1 Input 2 Output
32f single channel 32f single channel 32f single channel


Example

CuviSize aSize(3,3);

//Initialize input image
CuviImage A(aSize, CUVI_32FC1);

//Fill image with random values
cuvi::dataExchange::generateRandomImage(A);

CuviImage B;

//Perform matrix multiplication (A * A')
cuvi::arithmeticLogical::matMul(A,B);

//The order of multiplication can be reversed to (A' * A)
cuvi::arithmeticLogical::matMul(A,B,true);