Difference between revisions of "Function:MatMulTrans"

From CUVI Wiki
 
(3 intermediate revisions by the same user not shown)
Line 2: Line 2:
Performs matrix multiplication with its transpose.
Performs matrix multiplication with its transpose.


===Function===
====Function====
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">
CuviStatus matMulTrans(const CuviImage& A,
CuviStatus matMulTrans(const CuviImage& A,
Line 14: Line 14:
</syntaxhighlight>
</syntaxhighlight>
|}
|}
===Parameters===


====Parameters====
{|
|style="font-size:75%;"|
{|class="wikitable"
{|class="wikitable"
|-
|-
Line 33: Line 35:
| CuviStream&
| CuviStream&
| GPU stream ID for execution
| GPU stream ID for execution
 
|}
|}
|}


===Image Type Support===
====Image Type Support====
 
{|
|style="font-size:75%;"|
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 45: Line 48:
| 32f single channel
| 32f single channel
| 32f single channel
| 32f single channel
|}
|}
|}


 
====Example====
===Example===
{|
{|
|style="font-size:150%;"|
|style="font-size:100%;"|
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">



Latest revision as of 20:17, 18 October 2022

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 Output
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::matMulTrans(A,B);

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