FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
axpy.hpp
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#pragma once
7#ifndef KERNEL_LAFEM_ARCH_AXPY_HPP
8#define KERNEL_LAFEM_ARCH_AXPY_HPP 1
9
10// includes, FEAT
12#include <kernel/backend.hpp>
13#include <kernel/util/half.hpp>
14
15namespace FEAT
16{
17 namespace LAFEM
18 {
19 namespace Arch
20 {
21 struct Axpy
22 {
23 template <typename DT_>
24 static void value(DT_ * r, const DT_ a, const DT_ * const x, const Index size)
25 {
26 value_generic(r, a, x, size);
27 }
28
29 template <typename ValueType_>
30 static void value_blocked(ValueType_ * r, const ValueType_ a, const ValueType_ * const x, const Index size)
31 {
32 value_blocked_generic(r, a, x, size);
33 }
34
35#ifdef FEAT_HAVE_HALFMATH
36 static void value(Half * r, const Half a, const Half * const x, const Index size)
37 {
38 BACKEND_SKELETON_VOID(value_cuda, value_generic, value_generic, r, a, x, size)
39 }
40#endif
41
42 static void value(float * r, const float a, const float * const x, const Index size)
43 {
44 BACKEND_SKELETON_VOID(value_cuda, value_mkl, value_generic, r, a, x, size)
45 }
46
47 static void value(double * r, const double a, const double * const x, const Index size)
48 {
49 BACKEND_SKELETON_VOID(value_cuda, value_mkl, value_generic, r, a, x, size)
50 }
51
52 template <typename DT_>
53 static void value_generic(DT_ * r, const DT_ a, const DT_ * const x, const Index size);
54
55 static void value_mkl(float * r, const float a, const float * const x, const Index size);
56 static void value_mkl(double * r, const double a, const double * const x, const Index size);
57
58 template <typename DT_>
59 static void value_cuda(DT_ * r, const DT_ a, const DT_ * const x, const Index size);
60
61 template <typename ValueType_>
62 static void value_blocked_generic(ValueType_ * r, const ValueType_ a, const ValueType_ * const x, const Index size);
63 };
64
65#ifdef FEAT_EICKT
66 extern template void Axpy::value_generic(float *, const float, const float * const, const Index);
67 extern template void Axpy::value_generic(double *, const double, const double * const, const Index);
68#endif
69
70 } // namespace Arch
71 } // namespace LAFEM
72} // namespace FEAT
73
74#ifndef __CUDACC__
75#include <kernel/lafem/arch/axpy_generic.hpp>
76#endif
77#endif // KERNEL_LAFEM_ARCH_AXPY_HPP
FEAT Kernel base header.
FEAT namespace.
Definition: adjactor.hpp:12
__half Half
Half data type.
Definition: half.hpp:25
@ value
specifies whether the space should supply basis function values
std::uint64_t Index
Index data type.