M4RI
20140914
|
Matrix operations using Strassen's formulas including Winograd's improvements. More...
#include <math.h>
#include <m4ri/mzd.h>
#include <m4ri/brilliantrussian.h>
Go to the source code of this file.
Macros | |
#define | __M4RI_STRASSEN_MUL_CUTOFF MIN(((int)sqrt((double)(4 * __M4RI_CPU_L3_CACHE))), 4096) |
Functions | |
mzd_t * | mzd_mul (mzd_t *C, mzd_t const *A, mzd_t const *B, int cutoff) |
Matrix multiplication via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = AB. More... | |
mzd_t * | mzd_addmul (mzd_t *C, mzd_t const *A, mzd_t const *B, int cutoff) |
Matrix multiplication and in-place addition via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = C+ AB. More... | |
mzd_t * | _mzd_mul_even (mzd_t *C, mzd_t const *A, mzd_t const *B, int cutoff) |
Matrix multiplication via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = AB. More... | |
mzd_t * | _mzd_addmul_even (mzd_t *C, mzd_t const *A, mzd_t const *B, int cutoff) |
Matrix multiplication and in-place addition via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = C+ AB. More... | |
mzd_t * | _mzd_addmul (mzd_t *C, mzd_t const *A, mzd_t const *B, int cutoff) |
Matrix multiplication and in-place addition via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = C + AB. More... | |
Matrix operations using Strassen's formulas including Winograd's improvements.
#define __M4RI_STRASSEN_MUL_CUTOFF MIN(((int)sqrt((double)(4 * __M4RI_CPU_L3_CACHE))), 4096) |
The default cutoff for Strassen-Winograd multiplication. It should hold hold that 2 * (n^2)/8 fits into the L2 cache.
Matrix multiplication and in-place addition via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = C + AB.
The matrices A and B are respectively m x k and k x n, and can be not aligned on the m4ri_radix grid.
C | Preallocated product matrix, may be NULL for automatic creation. |
A | Input matrix A |
B | Input matrix B |
cutoff | Minimal dimension for Strassen recursion. |
Assumes that B and C are aligned in the same manner (as in a Schur complement)
Matrix multiplication and in-place addition via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = C+ AB.
This is the actual implementation. Any matrix where either the number of rows or the number of columns is smaller than cutoff is processed using the M4RM algorithm.
C | Preallocated product matrix, may be NULL for automatic creation. |
A | Input matrix A |
B | Input matrix B |
cutoff | Minimal dimension for Strassen recursion. |
Matrix multiplication via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = AB.
This is the actual implementation. Any matrix where either the number of rows or the number of columns is smaller than cutoff is processed using the M4RM algorithm.
C | Preallocated product matrix, may be NULL for automatic creation. |
A | Input matrix A |
B | Input matrix B |
cutoff | Minimal dimension for Strassen recursion. |
Matrix multiplication and in-place addition via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = C+ AB.
This is the wrapper function including bounds checks. See _mzd_addmul_even for implementation details.
C | product matrix |
A | Input matrix A |
B | Input matrix B |
cutoff | Minimal dimension for Strassen recursion. |
Matrix multiplication via the Strassen-Winograd matrix multiplication algorithm, i.e. compute C = AB.
This is the wrapper function including bounds checks. See _mzd_mul_even for implementation details.
C | Preallocated product matrix, may be NULL for automatic creation. |
A | Input matrix A |
B | Input matrix B |
cutoff | Minimal dimension for Strassen recursion. |