FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
slip_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_SLIP_FILTER_HPP
8#define KERNEL_LAFEM_ARCH_SLIP_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 SlipFilter
22 {
23 template <int BlockSize_, typename DT_, typename IT_>
24 static void filter_rhs(DT_ * v, const DT_ * const nu_elements, const IT_ * const sv_indices, const Index ue)
25 {
26 filter_rhs_generic<BlockSize_, DT_, IT_>(v, nu_elements, sv_indices, ue);
27 }
28
29 template <int BlockSize_>
30 static void filter_rhs(float * v, const float * const nu_elements, const std::uint64_t * const sv_indices, const Index ue)
31 {
32 BACKEND_SKELETON_VOID_T1(BlockSize_, filter_rhs_cuda, filter_rhs_generic, filter_rhs_generic, v, nu_elements, sv_indices, ue)
33 }
34
35 template <int BlockSize_>
36 static void filter_rhs(double * v, const double * const nu_elements, const std::uint64_t * const sv_indices, const Index ue)
37 {
38 BACKEND_SKELETON_VOID_T1(BlockSize_, filter_rhs_cuda, filter_rhs_generic, filter_rhs_generic, v, nu_elements, sv_indices, ue)
39 }
40
41 template <int BlockSize_>
42 static void filter_rhs(float * v, const float * const nu_elements, const std::uint32_t * const sv_indices, const Index ue)
43 {
44 BACKEND_SKELETON_VOID_T1(BlockSize_, filter_rhs_cuda, filter_rhs_generic, filter_rhs_generic, v, nu_elements, sv_indices, ue)
45 }
46
47 template <int BlockSize_>
48 static void filter_rhs(double * v, const double * const nu_elements, const std::uint32_t * const sv_indices, const Index ue)
49 {
50 BACKEND_SKELETON_VOID_T1(BlockSize_, filter_rhs_cuda, filter_rhs_generic, filter_rhs_generic, v, nu_elements, sv_indices, ue)
51 }
52
53 template <int BlockSize_, typename DT_, typename IT_>
54 static void filter_def(DT_ * v, const DT_ * const nu_elements, const IT_ * const sv_indices, const Index ue)
55 {
56 filter_def_generic<BlockSize_, DT_, IT_>(v, nu_elements, sv_indices, ue);
57 }
58
59 template <int BlockSize_>
60 static void filter_def(float * v, const float * const nu_elements, const std::uint64_t * const sv_indices, const Index ue)
61 {
62 BACKEND_SKELETON_VOID_T1(BlockSize_, filter_def_cuda, filter_def_generic, filter_def_generic, v, nu_elements, sv_indices, ue)
63 }
64
65 template <int BlockSize_>
66 static void filter_def(double * v, const double * const nu_elements, const std::uint64_t * const sv_indices, const Index ue)
67 {
68 BACKEND_SKELETON_VOID_T1(BlockSize_, filter_def_cuda, filter_def_generic, filter_def_generic, v, nu_elements, sv_indices, ue)
69 }
70
71 template <int BlockSize_>
72 static void filter_def(float * v, const float * const nu_elements, const std::uint32_t * const sv_indices, const Index ue)
73 {
74 BACKEND_SKELETON_VOID_T1(BlockSize_, filter_def_cuda, filter_def_generic, filter_def_generic, v, nu_elements, sv_indices, ue)
75 }
76
77 template <int BlockSize_>
78 static void filter_def(double * v, const double * const nu_elements, const std::uint32_t * const sv_indices, const Index ue)
79 {
80 BACKEND_SKELETON_VOID_T1(BlockSize_, filter_def_cuda, filter_def_generic, filter_def_generic, v, nu_elements, sv_indices, ue)
81 }
82
83 template <int BlockSize_, typename DT_, typename IT_>
84 static void filter_rhs_generic(DT_ * v, const DT_ * const nu_elements, const IT_ * const sv_indices, const Index ue);
85
86 template <int BlockSize_, typename DT_, typename IT_>
87 static void filter_def_generic(DT_ * v, const DT_ * const nu_elements, const IT_ * const sv_indices, const Index ue);
88
89 template <int BlockSize_, typename DT_, typename IT_>
90 static void filter_rhs_cuda(DT_ * v, const DT_ * const nu_elements, const IT_ * const sv_indices, const Index ue);
91
92 template <int BlockSize_, typename DT_, typename IT_>
93 static void filter_def_cuda(DT_ * v, const DT_ * const nu_elements, const IT_ * const sv_indices, const Index ue);
94 }; // SlipFilter
95
96 // Do not instantiate the following templates as this is done in slip_filter_generic.cpp and then linked
97 // into the shared library
98#ifdef FEAT_EICKT
99 extern template void SlipFilter::filter_rhs_generic<2, float, std::uint64_t>(float * v, const float * const nu_elements, const std::uint64_t * const sv_indices, const Index ue);
100 extern template void SlipFilter::filter_rhs_generic<2, double, std::uint64_t>(double * v, const double * const nu_elements, const std::uint64_t * const sv_indices, const Index ue);
101 extern template void SlipFilter::filter_rhs_generic<2, float, std::uint32_t>(float * v, const float * const nu_elements, const std::uint32_t * const sv_indices, const Index ue);
102 extern template void SlipFilter::filter_rhs_generic<2, double, std::uint32_t>(double * v, const double * const nu_elements, const std::uint32_t * const sv_indices, const Index ue);
103
104 extern template void SlipFilter::filter_def_generic<2, float, std::uint64_t>(float * v, const float * const nu_elements, const std::uint64_t * const sv_indices, const Index ue);
105 extern template void SlipFilter::filter_def_generic<2, double, std::uint64_t>(double * v, const double * const nu_elements, const std::uint64_t * const sv_indices, const Index ue);
106 extern template void SlipFilter::filter_def_generic<2, float, std::uint32_t>(float * v, const float * const nu_elements, const std::uint32_t * const sv_indices, const Index ue);
107 extern template void SlipFilter::filter_def_generic<2, double, std::uint32_t>(double * v, const double * const nu_elements, const std::uint32_t * const sv_indices, const Index ue);
108
109 extern template void SlipFilter::filter_rhs_generic<3, float, std::uint64_t>(float * v, const float * const nu_elements, const std::uint64_t * const sv_indices, const Index ue);
110 extern template void SlipFilter::filter_rhs_generic<3, double, std::uint64_t>(double * v, const double * const nu_elements, const std::uint64_t * const sv_indices, const Index ue);
111 extern template void SlipFilter::filter_rhs_generic<3, float, std::uint32_t>(float * v, const float * const nu_elements, const std::uint32_t * const sv_indices, const Index ue);
112 extern template void SlipFilter::filter_rhs_generic<3, double, std::uint32_t>(double * v, const double * const nu_elements, const std::uint32_t * const sv_indices, const Index ue);
113
114 extern template void SlipFilter::filter_def_generic<3, float, std::uint64_t>(float * v, const float * const nu_elements, const std::uint64_t * const sv_indices, const Index ue);
115 extern template void SlipFilter::filter_def_generic<3, double, std::uint64_t>(double * v, const double * const nu_elements, const std::uint64_t * const sv_indices, const Index ue);
116 extern template void SlipFilter::filter_def_generic<3, float, std::uint32_t>(float * v, const float * const nu_elements, const std::uint32_t * const sv_indices, const Index ue);
117 extern template void SlipFilter::filter_def_generic<3, double, std::uint32_t>(double * v, const double * const nu_elements, const std::uint32_t * const sv_indices, const Index ue);
118#endif
119 } // namespace Arch
120 } // namespace LAFEM
121} // namespace FEAT
122
124#ifndef __CUDACC__
125#include <kernel/lafem/arch/slip_filter_generic.hpp>
126#endif
127#endif // KERNEL_LAFEM_ARCH_SLIP_FILTER_HPP
FEAT Kernel base header.
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.