FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
dot_product_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
8#include <kernel/lafem/arch/dot_product.hpp>
9
10FEAT_DISABLE_WARNINGS
11#include <mkl.h>
12FEAT_RESTORE_WARNINGS
13
14
15using namespace FEAT;
16using namespace FEAT::LAFEM;
17using namespace FEAT::LAFEM::Arch;
18
19float DotProduct::value_mkl(const float * const x, const float * const y, const Index size)
20{
21 return cblas_sdot((MKL_INT)size, x, 1, y, 1);
22}
23
24double DotProduct::value_mkl(const double * const x, const double * const y, const Index size)
25{
26 return cblas_ddot((MKL_INT)size, x, 1, y, 1);
27}
28
29float TripleDotProduct::value_mkl(const float * const x, const float * const y, const float * const z, const Index size)
30{
31 float * temp(new float[size]);
32 vsMul((MKL_INT)size, y, z, temp);
33 float result = cblas_sdot((MKL_INT)size, x, 1, temp, 1);
34 delete[] temp;
35 return result;
36}
37
38double TripleDotProduct::value_mkl(const double * const x, const double * const y, const double * const z, const Index size)
39{
40 double * temp(new double[size]);
41 vdMul((MKL_INT)size, y, z, temp);
42 double result = cblas_ddot((MKL_INT)size, x, 1, temp, 1);
43 delete[] temp;
44 return result;
45}
FEAT Kernel base header.
LAFEM namespace.
Definition: apply.hpp:22
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.