FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
scale_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/scale.hpp>
9
10#include <cstring>
11FEAT_DISABLE_WARNINGS
12#include <mkl.h>
13FEAT_RESTORE_WARNINGS
14
15using namespace FEAT;
16using namespace FEAT::LAFEM;
17using namespace FEAT::LAFEM::Arch;
18
19void Scale::value_mkl(float * r, const float * const x, const float s, const Index size)
20{
21 if (r == x)
22 {
23 cblas_sscal((MKL_INT)size, s, r, 1);
24 }
25 else
26 {
27 std::memcpy(r, x, size * sizeof(float));
28 cblas_sscal((MKL_INT)size, s, r, 1);
29 }
30}
31
32void Scale::value_mkl(double * r, const double * const x, const double s, const Index size)
33{
34 if (r == x)
35 {
36 cblas_dscal((MKL_INT)size, s, r, 1);
37 }
38 else
39 {
40 std::memcpy(r, x, size * sizeof(double));
41 cblas_dscal((MKL_INT)size, s, r, 1);
42 }
43}
FEAT Kernel base header.
LAFEM namespace.
Definition: apply.hpp:22
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.