FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
unit_filter.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_UNIT_FILTER_HPP
8#define KERNEL_LAFEM_ARCH_UNIT_FILTER_HPP 1
9
10// includes, FEAT
12#include <kernel/backend.hpp>
13
15namespace FEAT
16{
17 namespace LAFEM
18 {
19 namespace Arch
20 {
21 struct UnitFilter
22 {
23 template <typename DT_, typename IT_>
24 static void filter_rhs(DT_ * v, const DT_ * const sv_elements, const IT_ * const sv_indices, const Index ue)
25 {
26 filter_rhs_generic(v, sv_elements, sv_indices, ue);
27 }
28
29 static void filter_rhs(float * v, const float * const sv_elements, const std::uint32_t * const sv_indices, const Index ue)
30 {
31 BACKEND_SKELETON_VOID(filter_rhs_cuda, filter_rhs_generic, filter_rhs_generic, v, sv_elements, sv_indices, ue)
32 }
33
34 static void filter_rhs(double * v, const double * const sv_elements, const std::uint32_t * const sv_indices, const Index ue)
35 {
36 BACKEND_SKELETON_VOID(filter_rhs_cuda, filter_rhs_generic, filter_rhs_generic, v, sv_elements, sv_indices, ue)
37 }
38
39 static void filter_rhs(float * v, const float * const sv_elements, const std::uint64_t * const sv_indices, const Index ue)
40 {
41 BACKEND_SKELETON_VOID(filter_rhs_cuda, filter_rhs_mkl, filter_rhs_generic, v, sv_elements, sv_indices, ue)
42 }
43
44 static void filter_rhs(double * v, const double * const sv_elements, const std::uint64_t * const sv_indices, const Index ue)
45 {
46 BACKEND_SKELETON_VOID(filter_rhs_cuda, filter_rhs_mkl, filter_rhs_generic, v, sv_elements, sv_indices, ue)
47 }
48
49 template <typename DT_, typename IT_>
50 static void filter_def(DT_ * v, const IT_ * const sv_indices, const Index ue)
51 {
52 filter_def_generic(v, sv_indices, ue);
53 }
54
55 template <typename IT_>
56 static void filter_def(float * v, const IT_ * const sv_indices, const Index ue)
57 {
58 BACKEND_SKELETON_VOID(filter_def_cuda, filter_def_generic, filter_def_generic, v, sv_indices, ue)
59 }
60
61 template <typename IT_>
62 static void filter_def(double * v, const IT_ * const sv_indices, const Index ue)
63 {
64 BACKEND_SKELETON_VOID(filter_def_cuda, filter_def_generic, filter_def_generic, v, sv_indices, ue)
65 }
66
67 template<typename DT_, typename IT_>
68 static void filter_unit_mat(DT_* mat, const IT_* const row_ptr, const IT_* const col_idx, const IT_ * const sv_indices, const Index ue)
69 {
70 filter_unit_mat_generic(mat, row_ptr, col_idx, sv_indices, ue);
71 }
72
73 template<typename IT_>
74 static void filter_unit_mat(double* mat, const IT_* const row_ptr, const IT_* const col_idx, const IT_ * const sv_indices, const Index ue)
75 {
76 BACKEND_SKELETON_VOID(filter_unit_mat_cuda, filter_unit_mat_generic, filter_unit_mat_generic, mat, row_ptr, col_idx, sv_indices, ue)
77 }
78
79 template<typename IT_>
80 static void filter_unit_mat(float* mat, const IT_* const row_ptr, const IT_* const col_idx, const IT_ * const sv_indices, const Index ue)
81 {
82 BACKEND_SKELETON_VOID(filter_unit_mat_cuda, filter_unit_mat_generic, filter_unit_mat_generic, mat, row_ptr, col_idx, sv_indices, ue)
83 }
84
85 template<typename DT_, typename IT_>
86 static void filter_offdiag_row_mat(DT_* mat, const IT_* const row_ptr, int block_width, const IT_ * const sv_indices, const Index ue)
87 {
88 filter_offdiag_row_mat_generic(mat, row_ptr, block_width, sv_indices, ue);
89 }
90
91 template<typename IT_>
92 static void filter_offdiag_row_mat(double* mat, const IT_* const row_ptr, int block_width, const IT_ * const sv_indices, const Index ue)
93 {
94 BACKEND_SKELETON_VOID(filter_offdiag_row_mat_cuda, filter_offdiag_row_mat_generic, filter_offdiag_row_mat_generic, mat, row_ptr, block_width, sv_indices, ue)
95 }
96
97 template<typename IT_>
98 static void filter_offdiag_row_mat(float* mat, const IT_* const row_ptr, int block_width, const IT_ * const sv_indices, const Index ue)
99 {
100 BACKEND_SKELETON_VOID(filter_offdiag_row_mat_cuda, filter_offdiag_row_mat_generic, filter_offdiag_row_mat_generic, mat, row_ptr, block_width, sv_indices, ue)
101 }
102
103 template<typename DT_, typename IT_>
104 static void filter_weak_matrix_rows(DT_* mat_a, const DT_* const mat_m, const IT_* const row_ptr, const DT_ * const sv_elements, const IT_ * const sv_indices, const Index ue)
105 {
106 filter_weak_matrix_rows_generic(mat_a, mat_m, row_ptr, sv_elements, sv_indices, ue);
107 }
108
109 template<typename IT_>
110 static void filter_weak_matrix_rows(double* mat_a, const double* const mat_m, const IT_* const row_ptr, const double * const sv_elements, const IT_ * const sv_indices, const Index ue)
111 {
112 BACKEND_SKELETON_VOID(filter_weak_matrix_rows_cuda, filter_weak_matrix_rows_generic, filter_weak_matrix_rows_generic, mat_a, mat_m, row_ptr, sv_elements, sv_indices, ue)
113 }
114
115 template<typename IT_>
116 static void filter_weak_matrix_rows(float* mat_a, const float* const mat_m, const IT_* const row_ptr, const float * const sv_elements, const IT_ * const sv_indices, const Index ue)
117 {
118 BACKEND_SKELETON_VOID(filter_weak_matrix_rows_cuda, filter_weak_matrix_rows_generic, filter_weak_matrix_rows_generic, mat_a, mat_m, row_ptr, sv_elements, sv_indices, ue)
119 }
120
121 template <typename DT_, typename IT_>
122 static void filter_rhs_generic(DT_ * v, const DT_ * const sv_elements, const IT_ * const sv_indices, const Index ue);
123
124 template <typename DT_, typename IT_>
125 static void filter_def_generic(DT_ * v, const IT_ * const sv_indices, const Index ue);
126
127 static void filter_rhs_mkl(float * v, const float * const sv_elements, const std::uint64_t * const sv_indices, const Index ue);
128 static void filter_rhs_mkl(double * v, const double * const sv_elements, const std::uint64_t * const sv_indices, const Index ue);
129
130 template <typename DT_, typename IT_>
131 static void filter_rhs_cuda(DT_ * v, const DT_ * const sv_elements, const IT_ * const sv_indices, const Index ue);
132
133 template <typename DT_, typename IT_>
134 static void filter_def_cuda(DT_ * v, const IT_ * const sv_indices, const Index ue);
135
136 template<typename DT_, typename IT_>
137 static void filter_unit_mat_generic(DT_* mat, const IT_* const row_ptr, const IT_* const col_idx, const IT_ * const sv_indices, const Index ue);
138
139 template<typename DT_, typename IT_>
140 static void filter_unit_mat_cuda(DT_* mat, const IT_* const row_ptr, const IT_* const col_idx, const IT_ * const sv_indices, const Index ue);
141
142 template<typename DT_, typename IT_>
143 static void filter_offdiag_row_mat_generic(DT_* mat, const IT_* const row_ptr, int block_width, const IT_ * const sv_indices, const Index ue);
144
145 template<typename DT_, typename IT_>
146 static void filter_offdiag_row_mat_cuda(DT_* mat, const IT_* const row_ptr, int block_width, const IT_ * const sv_indices, const Index ue);
147
148 template<typename DT_, typename IT_>
149 static void filter_weak_matrix_rows_generic(DT_* mat_a, const DT_* const mat_m, const IT_* const row_ptr, const DT_ * const sv_elements, const IT_ * const sv_indices, const Index ue);
150
151 template<typename DT_, typename IT_>
152 static void filter_weak_matrix_rows_cuda(DT_* mat_a, const DT_* const mat_m, const IT_* const row_ptr, const DT_ * const sv_elements, const IT_ * const sv_indices, const Index ue);
153 };
154
155#ifdef FEAT_EICKT
156 extern template void UnitFilter::filter_rhs_generic(float * v, const float * const sv_elements, const std::uint64_t * const sv_indices, const Index ue);
157 extern template void UnitFilter::filter_rhs_generic(double * v, const double * const sv_elements, const std::uint64_t * const sv_indices, const Index ue);
158 extern template void UnitFilter::filter_rhs_generic(float * v, const float * const sv_elements, const std::uint32_t * const sv_indices, const Index ue);
159 extern template void UnitFilter::filter_rhs_generic(double * v, const double * const sv_elements, const std::uint32_t * const sv_indices, const Index ue);
160
161 extern template void UnitFilter::filter_def_generic(float * v, const std::uint64_t * const sv_indices, const Index ue);
162 extern template void UnitFilter::filter_def_generic(double * v, const std::uint64_t * const sv_indices, const Index ue);
163 extern template void UnitFilter::filter_def_generic(float * v, const std::uint32_t * const sv_indices, const Index ue);
164 extern template void UnitFilter::filter_def_generic(double * v, const std::uint32_t * const sv_indices, const Index ue);
165#endif
166 } // namespace Arch
167 } // namespace LAFEM
168} // namespace FEAT
170
171#ifndef __CUDACC__
172#include <kernel/lafem/arch/unit_filter_generic.hpp>
173#endif
174#endif // KERNEL_LAFEM_ARCH_UNIT_FILTER_HPP
FEAT Kernel base header.
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.