class TSmallMatrixMultiply : public tObject;
Provides interface for multiplying small matrices by using the lapack's dgemm api standard.)
The matrix multiplication code is generated on the fly to achieve maximum possible performance. Additionally all the error checking on each consecutive call is also absent. This is most usefull, when the matrices to be multiplied are very small: 2x2 or 3x3, (100x) but there are still considerable benefits up to size 50x50 (1.3x) and more.
Typically this object would be created, then Init method is to be called and finally, one of the six Mul methods can be called multiple times.The class provides four variants of Multiply methods:
- Mul(a,b,c: TMtx);
- Mul;
- MulKernel
- MulKernelFloat, MulKernelDouble, MulKernelComplexFloat, MulKernelComplexDouble
It is most safe to use the first variant. Performance will increase with the parameterless Mul method (2x) and best performance can be obtained with the third variant (3x). Only switch to using the third variant when you are confident, that your algorithm works correctly.
Please note that
TMtx.Mul(A,B);
will use object cache to store JIT-ed kernels up to user specified matrix size for square matrices. The default limit is set at size 32x32. The kernel will be created on first call.
Destructors
| Name | Description |
|---|---|
| ~TSmallMatrixMultiply | The object is required to be freed manually. |
Properties
| Name | Type | Description |
|---|---|---|
| cCols | int | Field computed by Init method. Holds the row count of the matrix to hold the result. |
| cRows | int | Field computed by Init method. Holds the row count of the matrix to hold the result. |
Methods
| Name | Description |
|---|---|
| FreeKernel | Frees the internally jitted kernel |
| Init (4) | Initialize matrix multiplication |
| Mul (2) | Performs matrix multiplication optimized for small matrices |
Fields
| Name | Type | Description |
|---|---|---|
| Ap | intPtr | |
| bp | intPtr | |
| calpha | TSCplx | |
| cbeta | TSCplx | |
| cp | intPtr | |
| faCols | int | |
| faOp | TMtxOperation | |
| faRows | int | |
| fbCols | int | |
| fbOp | TMtxOperation | |
| fbRows | int | |
| fcCols | int | |
| fcRows | int | |
| FloatPrecision | TMtxFloatPrecision | Provides interface for multiplying small matrices by using the lapack's dgemm api standard.) |
| IsInit | bool | |
| JitKernel | intPtr | |
| jitter | intPtr | Jitted code pointer. |
| MulKernel | Tgemm_jit_kernel_tp | Function pointer to the jitted multiplication kernel. |
| MulKernelComplexDouble | Tzgemm_jit_kernel_t | Function pointer to the complex double precision jitted multiplication kernel. |
| MulKernelComplexFloat | Tcgemm_jit_kernel_t | Function pointer to the complex single precision jitted multiplication kernel. |
| MulKernelDouble | Tdgemm_jit_kernel_t | Function pointer to the double precision jitted multiplication kernel. |
| MulKernelFloat | Tsgemm_jit_kernel_t | Function pointer to the single precision jitted multiplication kernel. |
| zalpha | TCplx | |
| zbeta | TCplx |