You are here: Symbol Reference > MtxVec Namespace > Classes > TMtx Class > public > MulSmallInit Method > TMtx.MulSmallInit Method (TMtx, TMtx, TMtxOperation, TMtxOperation, double, double)
MtxVec VCL
ContentsIndex
PreviousUpNext
TMtx.MulSmallInit Method (TMtx, TMtx, TMtxOperation, TMtxOperation, double, double)

Initializes small matrix multiply according to lapacks dgemm api standard.

Pascal
function MulSmallInit(const A: TMtx; const B: TMtx; opA: TMtxOperation = opNone; opB: TMtxOperation = opNone; const alpha: double = 1; const beta: double = 0): boolean; overload;

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.

Copyright (c) 1999-2025 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!