#ifndef HPC_GEMM_REFCOLMAJOR_H #define HPC_GEMM_REFCOLMAJOR_H 1 #include "ulmblas.h" namespace refColMajor { template <typename T, typename Index> void gemm(Index m, Index n, Index k, T alpha, const T *A, Index incRowA, Index incColA, const T *B, Index incRowB, Index incColB, T beta, T *C, Index incRowC, Index incColC) { ulmBLAS::gescal(m, n, beta, C, incRowC, incColC); for (Index j=0; j<n; ++j) { for (Index l=0; l<k; ++l) { for (Index i=0; i<m; ++i) { C[i*incRowC+j*incColC] += alpha*A[i*incRowA+l*incColA] *B[l*incRowB+j*incColB]; } } } } } // namespace refColMajor #endif // HPC_GEMM_REFCOLMAJOR_H |