TSmallMatrixMultiply::Init Method

Overload List

#SignatureDescription
1bool Init(TMtx *A, TMtx *B, TMtx *C, TMtxOperation opA, TMtxOperation opB, const TCplx &Alpha, const TCplx &Beta);Initialize matrix multiplication
2bool Init(const int ARows, const int ACols, const int BRows, const int BCols, TMtxFloatPrecision aFloatPrecision, TMtxOperation opA, TMtxOperation opB, const double Alpha, const double Beta);Initialize matrix multiplication
3bool Init(const int ARows, const int ACols, const int BRows, const int BCols, TMtxFloatPrecision aFloatPrecision, TMtxOperation opA, TMtxOperation opB, const TCplx &Alpha, const TCplx &Beta);Initialize matrix multiplication
4bool Init(TMtx *A, TMtx *B, TMtx *C, TMtxOperation opA, TMtxOperation opB, const double Alpha, const double Beta);Initialize matrix multiplication

Overload 1: bool Init(TMtx *A, TMtx *B, TMtx *C, TMtxOperation opA, TMtxOperation opB, const TCplx &Alpha, const TCplx &Beta);

Initialize matrix multiplication

#NameTypeDescription
1ATMtx *Matrix A.
2BTMtx *Matrix B.
3CTMtx *Matrix C.
4opATMtxOperationRequest matrix A transpose.
5opBTMtxOperationRequest matrix B transpose.
6Alphaconst TCplx &Scaling factor.
7Betaconst TCplx &Scaling factor.
Remarks:

Initializes computation of:

C = alpha*opA(A)*opB(B) + beta*C

The procedure will initialize matrix multiplication and create in-memory code specifically designed to multiply exactly these matrices with the specified operators. (just-in-time compilation).

This design makes the performance efficient multiplication of "small" matrices possible.

To perform actual multiplication call one of the Mul methods of this object. The matrices passed must unconditionally match the parameters (size and layout) as they had when they were passed to this (Init) routine.

The parameterless Mul routine assumes also the same memory locations at which matrices A, B and C store their data and is slightly faster than the alternative Mul method. This means, that A,B and C may not be resized after calling Init.

Init can be called multiple times. Each call will overwrite the previous settings. The alpha and beta parameters are specified as complex type, but only the real part will be used when A, B and C are not complex.

Returns true if JIT will be used and false otherwise. If the JIT will not be used standard dgemm routine will be called instead. The procedure of JIT compilation is about 1000x slower, than the actual multiply operation. The kernel(s) therefore must be prepared upfront.

The Init routine is protected against initializing with same parameters again and will simply exit and reuse the existing kernel.

Declared in Dew::Math::TSmallMatrixMultiply · Dew.Math/MtxVec.h · Cross-compiler

Overload 2: bool Init(const int ARows, const int ACols, const int BRows, const int BCols, TMtxFloatPrecision aFloatPrecision, TMtxOperation opA, TMtxOperation opB, const double Alpha, const double Beta);

Initialize matrix multiplication

#NameTypeDescription
1ARowsconst intMatrix A row count.
2AColsconst intMatrix A column count.
3BRowsconst intMatrix B row count.
4BColsconst intMatrix B column count.
5aFloatPrecisionTMtxFloatPrecisionThe storage precision of all three matrices, A, B and C.
6opATMtxOperationRequest matrix A transpose.
7opBTMtxOperationRequest matrix B transpose.
8Alphaconst doubleScaling factor.
9Betaconst doubleScaling factor.
Remarks:

Initializes computation of:

C = alpha*opA(A)*opB(B) + beta*C

Returns true if JIT will be used and false otherwise. If the JIT will not be used standard dgemm routine will be called instead. The procedure of JIT compilation is about 1000x slower, than the actual multiply operation. The kernel(s) therefore must be prepared upfront.

The Init routine is protected against initializing with same parameters again and will simply exit and reuse the existing kernel.

Declared in Dew::Math::TSmallMatrixMultiply · Dew.Math/MtxVec.h · Cross-compiler

Overload 3: bool Init(const int ARows, const int ACols, const int BRows, const int BCols, TMtxFloatPrecision aFloatPrecision, TMtxOperation opA, TMtxOperation opB, const TCplx &Alpha, const TCplx &Beta);

Initialize matrix multiplication

#NameTypeDescription
1ARowsconst intMatrix A row count.
2AColsconst intMatrix A column count.
3BRowsconst intMatrix B row count.
4BColsconst intMatrix B column count.
5aFloatPrecisionTMtxFloatPrecisionThe storage precision of all three matrices, A, B and C.
6opATMtxOperationRequest matrix A transpose.
7opBTMtxOperationRequest matrix B transpose.
8Alphaconst TCplx &Scaling factor.
9Betaconst TCplx &Scaling factor.
Remarks:

Initializes computation of:

C = alpha*opA(A)*opB(B) + beta*C

Returns true if JIT will be used and false otherwise. If the JIT will not be used, the standard dgemm routine will be called instead. The procedure of JIT compilation is about 1000x slower, than the actual multiply operation. The kernel(s) therefore must be prepared upfront.

The Init routine is protected against initializing with same parameters again and will simply exit and reuse the existing kernel.

Declared in Dew::Math::TSmallMatrixMultiply · Dew.Math/MtxVec.h · Cross-compiler

Overload 4: bool Init(TMtx *A, TMtx *B, TMtx *C, TMtxOperation opA, TMtxOperation opB, const double Alpha, const double Beta);

Initialize matrix multiplication

#NameTypeDescription
1ATMtx *Matrix A.
2BTMtx *Matrix B.
3CTMtx *Matrix C.
4opATMtxOperationRequest matrix A transpose.
5opBTMtxOperationRequest matrix B transpose.
6Alphaconst doubleScaling factor.
7Betaconst doubleScaling factor.
Remarks:

Initializes computation of:

C = alpha*opA(A)*opB(B) + beta*C

The procedure will initialize matrix multiplication and create in-memory code specifically designed to multiply exactly these matrices with the specified operators. (just-in-time compilation).

This design makes the performance efficient multiplication of "small" matrices possible.

To perform actual multiplication call one of the Mul methods of this object. The matrices passed must unconditionally match the parameters (size and layout) as they had when they were passed to this (Init) routine.

The parameterless Mul routine assumes also the same memory locations at which matrices A, B and C store their data and is slightly faster than the alternative Mul method. This means, that A,B and C may not be resized after calling Init.

Init can be called multiple times. Each call will overwrite the previous settings. The alpha and beta parameters are specified as complex type, but only the real part will be used when A, B and C are not complex.

The Init routine is protected against initializing with same parameters again and will simply exit and reuse the existing kernel.

Returns true if JIT will be used and false otherwise. If the JIT will not be used standard dgemm routine will be called instead. The procedure of JIT compilation is about 1000x slower, than the actual multiply operation.

Declared in Dew::Math::TSmallMatrixMultiply · Dew.Math/MtxVec.h · Cross-compiler