FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
matmatmult_dense_dense_mkl.cpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6// includes, FEAT
9#include <kernel/lafem/arch/matmatmult_dense_dense.hpp>
10
11#include <mkl_blas.h>
12
13namespace FEAT::LAFEM::Arch
14{
15 void MatMatMultDenseDense::exec_mkl_impl(float * r, const float alpha, const float * const x, const float * const y, const float * const z, const Index rows, const Index cols, const Index inner)
16 {
17 XASSERT((r == z) || (z == nullptr));
18 MKL_INT mrows = (MKL_INT)rows;
19 MKL_INT mcolumns = (MKL_INT)cols;
20 MKL_INT minner = (MKL_INT)inner;
21 char trans = 'N';
22 float beta(z == nullptr ? 0.0f :1.0f);
23 sgemm(&trans, &trans, &mcolumns, &mrows, &minner, &alpha, y, &mcolumns, x, &minner, &beta, r, &mcolumns);
24 }
25
26 void MatMatMultDenseDense::exec_mkl_impl(double * r, const double alpha, const double * const x, const double * const y, const double * const z, const Index rows, const Index cols, const Index inner)
27 {
28 XASSERT((r == z) || (z == nullptr));
29 MKL_INT mrows = (MKL_INT)rows;
30 MKL_INT mcolumns = (MKL_INT)cols;
31 MKL_INT minner = (MKL_INT)inner;
32 char trans = 'N';
33 double beta(z == nullptr ? 0.0 :1.0);
34 dgemm(&trans, &trans, &mcolumns, &mrows, &minner, &alpha, y, &mcolumns, x, &minner, &beta, r, &mcolumns);
35 }
36} // namespace FEAT::LAFEM::Arch
#define XASSERT(expr)
Assertion macro definition.
Definition: assertion.hpp:262
FEAT Kernel base header.
std::uint64_t Index
Index data type.