Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 43 additions & 11 deletions math/matrix/src/TMatrixT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3077,22 +3077,54 @@
/// Elementary routine to calculate matrix multiplication A*B

template <class Element>
void TMatrixTAutoloadOps::AMultB(const Element *const ap, Int_t na, Int_t ncolsa, const Element *const bp, Int_t nb,

Check failure on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / debian13 dev=ON, CMAKE_CXX_FLAGS=-Wsuggest-override

unused parameter ‘nb’ [-Werror=unused-parameter]

Check failure on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / debian13 dev=ON, CMAKE_CXX_FLAGS=-Wsuggest-override

unused parameter ‘nb’ [-Werror=unused-parameter]

Check failure on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / debian125 CMAKE_CXX_STANDARD=20, dev=ON, CMAKE_CXX_FLAGS=-Wsuggest-override

unused parameter ‘nb’ [-Werror=unused-parameter]

Check failure on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / debian125 CMAKE_CXX_STANDARD=20, dev=ON, CMAKE_CXX_FLAGS=-Wsuggest-override

unused parameter ‘nb’ [-Werror=unused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2504 CMAKE_CXX_STANDARD=23

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2504 CMAKE_CXX_STANDARD=23

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma8

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma8

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac26 ARM64

unused parameter 'nb' [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma9 modules_off runtime_cxxmodules=Off

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma9 modules_off runtime_cxxmodules=Off

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / rawhide Fedora pydebug CMAKE_CXX_STANDARD=23

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / rawhide Fedora pydebug CMAKE_CXX_STANDARD=23

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / fedora43

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / fedora43

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma10

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma10

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma9 arm64 CMAKE_BUILD_TYPE=RelWithDebInfo, builtin_zlib=ON, builtin_zstd=ON

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma9 arm64 CMAKE_BUILD_TYPE=RelWithDebInfo, builtin_zlib=ON, builtin_zstd=ON

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac15 ARM64 CMAKE_CXX_STANDARD=23

unused parameter 'nb' [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma10 clang Ninja CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

unused parameter 'nb' [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / fedora42 CMAKE_CXX_STANDARD=23

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / fedora42 CMAKE_CXX_STANDARD=23

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac14 X64 CMAKE_CXX_STANDARD=20

unused parameter 'nb' [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma9 march_native CMAKE_BUILD_TYPE=RelWithDebInfo, CMAKE_CXX_FLAGS=-march=native, CMAKE_C_FLAGS=-march=native, builtin_zlib=ON, builtin_zstd=ON

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma9 march_native CMAKE_BUILD_TYPE=RelWithDebInfo, CMAKE_CXX_FLAGS=-march=native, CMAKE_C_FLAGS=-march=native, builtin_zlib=ON, builtin_zstd=ON

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac-beta ARM64

unused parameter 'nb' [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / ubuntu22 imt=Off, CMAKE_BUILD_TYPE=Debug

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / ubuntu22 imt=Off, CMAKE_BUILD_TYPE=Debug

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2510

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2510

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma9 CMAKE_BUILD_TYPE=Debug

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma9 CMAKE_BUILD_TYPE=Debug

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2404 CMAKE_BUILD_TYPE=Debug

unused parameter ‘nb’ [-Wunused-parameter]

Check warning on line 3080 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / ubuntu2404 CMAKE_BUILD_TYPE=Debug

unused parameter ‘nb’ [-Wunused-parameter]
Int_t ncolsb, Element *cp)
{
const Element *arp0 = ap; // Pointer to A[i,0];
while (arp0 < ap + na) {
for (const Element *bcp = bp; bcp < bp + ncolsb;) { // Pointer to the j-th column of B, Start bcp = B[0,0]
const Element *arp = arp0; // Pointer to the i-th row of A, reset to A[i,0]
Element cij = 0;
while (bcp < bp + nb) { // Scan the i-th row of A and
cij += *arp++ * *bcp; // the j-th col of B
bcp += ncolsb;
// i,k,j loop order with blocking and unrolling
const Int_t M = na / ncolsa; // Rows of A
const Int_t N = ncolsa; // Columns of A, rows of B
const Int_t P = ncolsb; // Columns of B and C

const Int_t BLOCK = 32;

#ifdef _OPENMP
#pragma omp parallel for collapse(2) if (M * P > 10000)
#endif
for (Int_t i0 = 0; i0 < M; i0 += BLOCK) {
for (Int_t k0 = 0; k0 < N; k0 += BLOCK) {
for (Int_t j0 = 0; j0 < P; j0 += BLOCK) {
const Int_t iMax = (i0 + BLOCK < M) ? i0 + BLOCK : M;
const Int_t kMax = (k0 + BLOCK < N) ? k0 + BLOCK : N;
const Int_t jMax = (j0 + BLOCK < P) ? j0 + BLOCK : P;
for (Int_t i = i0; i < iMax; ++i) {
for (Int_t k = k0; k < kMax; ++k) {
Element aik = ap[i * N + k]; // Hoist A[i,k]
Int_t j = j0;
#pragma GCC ivdep

Check warning on line 3103 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac26 ARM64

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 3103 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac15 ARM64 CMAKE_CXX_STANDARD=23

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 3103 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma10 clang Ninja CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 3103 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac14 X64 CMAKE_CXX_STANDARD=20

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 3103 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac-beta ARM64

unknown pragma ignored [-Wunknown-pragmas]
for (; j <= jMax - 4; j += 4) {
// Unroll by 4: update C[i,j], C[i,j+1], C[i,j+2], C[i,j+3]
Element cij0 = cp[i * P + j];
Element cij1 = cp[i * P + (j + 1)];
Element cij2 = cp[i * P + (j + 2)];
Element cij3 = cp[i * P + (j + 3)];
cij0 += aik * bp[k * P + j];
cij1 += aik * bp[k * P + (j + 1)];
cij2 += aik * bp[k * P + (j + 2)];
cij3 += aik * bp[k * P + (j + 3)];
cp[i * P + j] = cij0;
cp[i * P + (j + 1)] = cij1;
cp[i * P + (j + 2)] = cij2;
cp[i * P + (j + 3)] = cij3;
}
#pragma GCC ivdep

Check warning on line 3119 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac26 ARM64

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 3119 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac15 ARM64 CMAKE_CXX_STANDARD=23

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 3119 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / alma10 clang Ninja CMAKE_C_COMPILER=clang, CMAKE_CXX_COMPILER=clang++

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 3119 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac14 X64 CMAKE_CXX_STANDARD=20

unknown pragma ignored [-Wunknown-pragmas]

Check warning on line 3119 in math/matrix/src/TMatrixT.cxx

View workflow job for this annotation

GitHub Actions / mac-beta ARM64

unknown pragma ignored [-Wunknown-pragmas]
for (; j < jMax; ++j) {
// Cleanup loop for remaining j
cp[i * P + j] += aik * bp[k * P + j];
}
}
}
}
*cp++ = cij;
bcp -= nb - 1; // Set bcp to the (j+1)-th col
}
arp0 += ncolsa; // Set ap to the (i+1)-th row
}
}

Expand Down
Loading