TMtx.MulSmallInit Method

Overload List

#SignatureDescription
1Boolean MulSmallInit(TMtx A, TMtx B, TMtxOperation opA, TMtxOperation opB, TCplx alpha, TCplx beta)Initializes small matrix multiply according to lapacks dgemm api standard.
2Boolean MulSmallInit(TMtx A, TMtx B, TMtxOperation opA, TMtxOperation opB, Double alpha, Double beta)Initializes small matrix multiply according to lapacks dgemm api standard.

Overload 1: Boolean MulSmallInit(TMtx A, TMtx B, TMtxOperation opA, TMtxOperation opB, TCplx alpha, TCplx beta)

Initializes small matrix multiply according to lapacks dgemm api standard.

#NameTypeDescription
1ATMtxsource TMtx
2BTMtxsource TMtx
3opATMtxOperation
4opBTMtxOperation
5alphaTCplxscalar
6betaTCplxscalar

Returns: Boolean

Remarks:

Initializes compute of: C = alpha*opA(A)*opB(B)+ beta*C

The routine generates code by using JIT (just in time compilation) to create a kernel, which is optimized for the specified parameters. To release existing kernel and create a new one call this routine again. The process of creating a kernel is about 1000x slower than multiplying two matrices with size 2x2. The JIT targets small matrices and will fallback to standard dgemm for large matrices.

The routine will set the size the calling matrix to match the size of the result of the multiplication.

The actual matrix multiplication is performed by calling TMtx.MulSmall method.

The function returns true, if custom code kernel was created. It returns false, if the code was routed to the default dgemm/zgemm routine, because the two matrices are too big to expect an improvement.

It is safe to call this method with the same parameters more than once. The internal kernel will not be recreated, if the parameters other than A and B have not changed.

Overload 2: Boolean MulSmallInit(TMtx A, TMtx B, TMtxOperation opA, TMtxOperation opB, Double alpha, Double beta)

Initializes small matrix multiply according to lapacks dgemm api standard.

#NameTypeDescription
1ATMtxsource TMtx
2BTMtxsource TMtx
3opATMtxOperation
4opBTMtxOperation
5alphaDoublescalar
6betaDoublescalar

Returns: Boolean

Remarks:

Initializes compute of: C = alpha*opA(A)*opB(B)+ beta*C

The routine generates code by using JIT (just in time compilation) to create a kernel, which is optimized for the specified parameters. To release existing kernel and create a new one call this routine again. The process of creating a kernel is about 1000x slower than multiplying two matrices with size 2x2. The JIT targets small matrices and will fallback to standard dgemm for large matrices.

The routine will set the size the calling matrix to match the size of the result of the multiplication.

The actual matrix multiplication is performed by calling TMtx.MulSmall

The function returns true, if custom code kernel was created. It returns false, if the code was routed to the default dgemm/zgemm routine, because the two matrices are too big to expect an improvement.

It is safe to call this method with the same parameters more than once. The internal kernel will not be recreated, if the parameters other than A and B have not changed.