FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
mirror.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_MIRROR_HPP
8#define KERNEL_LAFEM_ARCH_MIRROR_HPP 1
9
10// includes, FEAT
12#include <kernel/backend.hpp>
13
14namespace FEAT
15{
16 namespace LAFEM
17 {
18 namespace Arch
19 {
20 struct Mirror
21 {
22 template<typename DT_, typename IT_>
23 static void gather_dv(const Index boff, const Index nidx, const IT_* idx, DT_* buf, const DT_* vec)
24 {
25 gather_dv_generic(boff, nidx, idx, buf, vec);
26 }
27
28 static void gather_dv(const Index boff, const Index nidx, const std::uint32_t * idx, float * buf, const float * vec)
29 {
30 BACKEND_SKELETON_VOID(gather_dv_cuda, gather_dv_generic, gather_dv_generic, boff, nidx, idx, buf, vec)
31 }
32
33 static void gather_dv(const Index boff, const Index nidx, const std::uint64_t * idx, float * buf, const float * vec)
34 {
35 BACKEND_SKELETON_VOID(gather_dv_cuda, gather_dv_generic, gather_dv_generic, boff, nidx, idx, buf, vec)
36 }
37
38 static void gather_dv(const Index boff, const Index nidx, const std::uint32_t * idx, double * buf, const double * vec)
39 {
40 BACKEND_SKELETON_VOID(gather_dv_cuda, gather_dv_generic, gather_dv_generic, boff, nidx, idx, buf, vec)
41 }
42
43 static void gather_dv(const Index boff, const Index nidx, const std::uint64_t * idx, double * buf, const double * vec)
44 {
45 BACKEND_SKELETON_VOID(gather_dv_cuda, gather_dv_generic, gather_dv_generic, boff, nidx, idx, buf, vec)
46 }
47
48 template<typename DT_, typename IT_>
49 static void scatter_dv(const Index boff, const Index nidx, const IT_* idx, const DT_* buf, DT_* vec, const DT_ alpha)
50 {
51 scatter_dv_generic(boff, nidx, idx, buf, vec, alpha);
52 }
53
54 static void scatter_dv(const Index boff, const Index nidx, const std::uint32_t * idx, const float * buf, float * vec, const float alpha)
55 {
56 BACKEND_SKELETON_VOID(scatter_dv_cuda, scatter_dv_generic, scatter_dv_generic, boff, nidx, idx, buf, vec, alpha)
57 }
58
59 static void scatter_dv(const Index boff, const Index nidx, const std::uint64_t * idx, const float * buf, float * vec, const float alpha)
60 {
61 BACKEND_SKELETON_VOID(scatter_dv_cuda, scatter_dv_generic, scatter_dv_generic, boff, nidx, idx, buf, vec, alpha)
62 }
63
64 static void scatter_dv(const Index boff, const Index nidx, const std::uint32_t * idx, const double * buf, double * vec, const double alpha)
65 {
66 BACKEND_SKELETON_VOID(scatter_dv_cuda, scatter_dv_generic, scatter_dv_generic, boff, nidx, idx, buf, vec, alpha)
67 }
68
69 static void scatter_dv(const Index boff, const Index nidx, const std::uint64_t * idx, const double * buf, double * vec, const double alpha)
70 {
71 BACKEND_SKELETON_VOID(scatter_dv_cuda, scatter_dv_generic, scatter_dv_generic, boff, nidx, idx, buf, vec, alpha)
72 }
73
74 template<typename DT_, typename IT_>
75 static void gather_dvb(const Index bs, const Index boff, const Index nidx, const IT_* idx, DT_* buf, const DT_* vec)
76 {
77 gather_dvb_generic(bs, boff, nidx, idx, buf, vec);
78 }
79
80 static void gather_dvb(const Index bs, const Index boff, const Index nidx, const std::uint32_t * idx, float * buf, const float * vec)
81 {
82 BACKEND_SKELETON_VOID(gather_dvb_cuda, gather_dvb_generic, gather_dvb_generic, bs, boff, nidx, idx, buf, vec)
83 }
84
85 static void gather_dvb(const Index bs, const Index boff, const Index nidx, const std::uint64_t * idx, float * buf, const float * vec)
86 {
87 BACKEND_SKELETON_VOID(gather_dvb_cuda, gather_dvb_generic, gather_dvb_generic, bs, boff, nidx, idx, buf, vec)
88 }
89
90 static void gather_dvb(const Index bs, const Index boff, const Index nidx, const std::uint32_t * idx, double * buf, const double * vec)
91 {
92 BACKEND_SKELETON_VOID(gather_dvb_cuda, gather_dvb_generic, gather_dvb_generic, bs, boff, nidx, idx, buf, vec)
93 }
94
95 static void gather_dvb(const Index bs, const Index boff, const Index nidx, const std::uint64_t * idx, double * buf, const double * vec)
96 {
97 BACKEND_SKELETON_VOID(gather_dvb_cuda, gather_dvb_generic, gather_dvb_generic, bs, boff, nidx, idx, buf, vec)
98 }
99
100 template<typename DT_, typename IT_>
101 static void scatter_dvb(const Index bs, const Index boff, const Index nidx, const IT_* idx, const DT_* buf, DT_* vec, const DT_ alpha)
102 {
103 scatter_dvb_generic(bs, boff, nidx, idx, buf, vec, alpha);
104 }
105
106 static void scatter_dvb(const Index bs, const Index boff, const Index nidx, const std::uint32_t * idx, const float * buf, float * vec, const float alpha)
107 {
108 BACKEND_SKELETON_VOID(scatter_dvb_cuda, scatter_dvb_generic, scatter_dvb_generic, bs, boff, nidx, idx, buf, vec, alpha)
109 }
110
111 static void scatter_dvb(const Index bs, const Index boff, const Index nidx, const std::uint64_t * idx, const float * buf, float * vec, const float alpha)
112 {
113 BACKEND_SKELETON_VOID(scatter_dvb_cuda, scatter_dvb_generic, scatter_dvb_generic, bs, boff, nidx, idx, buf, vec, alpha)
114 }
115
116 static void scatter_dvb(const Index bs, const Index boff, const Index nidx, const std::uint32_t * idx, const double * buf, double * vec, const double alpha)
117 {
118 BACKEND_SKELETON_VOID(scatter_dvb_cuda, scatter_dvb_generic, scatter_dvb_generic, bs, boff, nidx, idx, buf, vec, alpha)
119 }
120
121 static void scatter_dvb(const Index bs, const Index boff, const Index nidx, const std::uint64_t * idx, const double * buf, double * vec, const double alpha)
122 {
123 BACKEND_SKELETON_VOID(scatter_dvb_cuda, scatter_dvb_generic, scatter_dvb_generic, bs, boff, nidx, idx, buf, vec, alpha)
124 }
125
126 template<typename DT_, typename IT_>
127 static void gather_sv(const Index boff, const Index nidx, const IT_* idx, DT_* buf, const Index nvec, const DT_* vval, const IT_* vidx)
128 {
129 gather_sv_generic(boff, nidx, idx, buf, nvec, vval, vidx);
130 }
131
132 template<typename DT_, typename IT_>
133 static void scatter_sv(const Index boff, const Index nidx, const IT_* idx, const DT_* buf, const Index nvec, DT_* vval, const IT_* vidx, const DT_ alpha)
134 {
135 scatter_sv_generic(boff, nidx, idx, buf, nvec, vval, vidx, alpha);
136 }
137
138 template<typename DT_, typename IT_>
139 static void gather_svb(const Index bs, const Index boff, const Index nidx, const IT_* idx, DT_* buf, const Index nvec, const DT_* vval, const IT_* vidx)
140 {
141 gather_svb_generic(bs, boff, nidx, idx, buf, nvec, vval, vidx);
142 }
143
144 template<typename DT_, typename IT_>
145 static void scatter_svb(const Index bs, const Index boff, const Index nidx, const IT_* idx, const DT_* buf, const Index nvec, DT_* vval, const IT_* vidx, const DT_ alpha)
146 {
147 scatter_svb_generic(bs, boff, nidx, idx, buf, nvec, vval, vidx, alpha);
148 }
149
150 // generic declarations
151
152 template<typename DT_, typename IT_>
153 static void gather_dv_generic(const Index boff, const Index nidx, const IT_* idx, DT_* buf, const DT_* vec);
154
155 template<typename DT_, typename IT_>
156 static void scatter_dv_generic(const Index boff, const Index nidx, const IT_* idx, const DT_* buf, DT_* vec, const DT_ alpha);
157
158 template<typename DT_, typename IT_>
159 static void gather_dvb_generic(const Index bs, const Index boff, const Index nidx, const IT_* idx, DT_* buf, const DT_* vec);
160
161 template<typename DT_, typename IT_>
162 static void scatter_dvb_generic(const Index bs, const Index boff, const Index nidx, const IT_* idx, const DT_* buf, DT_* vec, const DT_ alpha);
163
164 template<typename DT_, typename IT_>
165 static void gather_sv_generic(const Index boff, const Index nidx, const IT_* idx, DT_* buf, const Index nvec, const DT_* vval, const IT_* vidx);
166
167 template<typename DT_, typename IT_>
168 static void scatter_sv_generic(const Index boff, const Index nidx, const IT_* idx, const DT_* buf, const Index nvec, DT_* vval, const IT_* vidx, const DT_ alpha);
169
170 template<typename DT_, typename IT_>
171 static void gather_svb_generic(const Index bs, const Index boff, const Index nidx, const IT_* idx, DT_* buf, const Index nvec, const DT_* vval, const IT_* vidx);
172
173 template<typename DT_, typename IT_>
174 static void scatter_svb_generic(const Index bs, const Index boff, const Index nidx, const IT_* idx, const DT_* buf, const Index nvec, DT_* vval, const IT_* vidx, const DT_ alpha);
175
176 template<typename DT_, typename IT_>
177 static void gather_dv_cuda(const Index boff, const Index nidx, const IT_* idx, DT_* buf, const DT_* vec);
178
179 template<typename DT_, typename IT_>
180 static void scatter_dv_cuda(const Index boff, const Index nidx, const IT_* idx, const DT_* buf, DT_* vec, const DT_ alpha);
181
182 template<typename DT_, typename IT_>
183 static void gather_dvb_cuda(const Index bs, const Index boff, const Index nidx, const IT_* idx, DT_* buf, const DT_* vec);
184
185 template<typename DT_, typename IT_>
186 static void scatter_dvb_cuda(const Index bs, const Index boff, const Index nidx, const IT_* idx, const DT_* buf, DT_* vec, const DT_ alpha);
187
189
190 }; // struct Mirror
191
192 } // namespace Arch
193 } // namespace LAFEM
194} // namespace FEAT
195
196#ifndef __CUDACC__
197#include <kernel/lafem/arch/mirror_generic.hpp>
198#endif
199#endif // KERNEL_LAFEM_ARCH_MIRROR_HPP
FEAT Kernel base header.
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.