FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
lumping.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_LUMPING_HPP
8#define KERNEL_LAFEM_ARCH_LUMPING_HPP 1
9
10// includes, FEAT
12#include <kernel/backend.hpp>
13
14
15namespace FEAT
16{
17 namespace LAFEM
18 {
19 namespace Arch
20 {
21 struct Lumping
22 {
23 template <typename DT_, typename IT_>
24 static void csr(DT_ * lump, const DT_ * const val, const IT_ * const col_ind, const IT_ * const row_ptr, const Index rows)
25 {
26 csr_generic(lump, val, col_ind, row_ptr, rows);
27 }
28
29 static void csr(float * lump, const float * const val, const std::uint64_t * const col_ind, const std::uint64_t * const row_ptr, const Index rows)
30 {
31 BACKEND_SKELETON_VOID(csr_cuda, csr_generic, csr_generic, lump, val, col_ind, row_ptr, rows)
32 }
33
34 static void csr(double * lump, const double * const val, const std::uint64_t * const col_ind, const std::uint64_t * const row_ptr, const Index rows)
35 {
36 BACKEND_SKELETON_VOID(csr_cuda, csr_generic, csr_generic, lump, val, col_ind, row_ptr, rows)
37 }
38
39 static void csr(float * lump, const float * const val, const std::uint32_t * const col_ind, const std::uint32_t * const row_ptr, const Index rows)
40 {
41 BACKEND_SKELETON_VOID(csr_cuda, csr_generic, csr_generic, lump, val, col_ind, row_ptr, rows)
42 }
43
44 static void csr(double * lump, const double * const val, const std::uint32_t * const col_ind, const std::uint32_t * const row_ptr, const Index rows)
45 {
46 BACKEND_SKELETON_VOID(csr_cuda, csr_generic, csr_generic, lump, val, col_ind, row_ptr, rows)
47 }
48
49 template <typename DT_, typename IT_>
50 static void csr_generic(DT_ * lump, const DT_ * const val, const IT_ * const col_ind, const IT_ * const row_ptr, const Index rows);
51
52 template <typename DT_, typename IT_>
53 static void bcsr(DT_ * lump, const DT_ * const val, const IT_ * const col_ind, const IT_ * const row_ptr, const Index rows, const int BlockHeight, const int BlockWidth)
54 {
55 bcsr_generic(lump, val, col_ind, row_ptr, rows, BlockHeight, BlockWidth);
56 }
57
58 static void bcsr(float * lump, const float * const val, const std::uint64_t * const col_ind, const std::uint64_t * const row_ptr, const Index rows, const int BlockHeight, const int BlockWidth)
59 {
60 BACKEND_SKELETON_VOID(bcsr_cuda, bcsr_generic, bcsr_generic, lump, val, col_ind, row_ptr, rows, BlockHeight, BlockWidth)
61 }
62
63 static void bcsr(double * lump, const double * const val, const std::uint64_t * const col_ind, const std::uint64_t * const row_ptr, const Index rows, const int BlockHeight, const int BlockWidth)
64 {
65 BACKEND_SKELETON_VOID(bcsr_cuda, bcsr_generic, bcsr_generic, lump, val, col_ind, row_ptr, rows, BlockHeight, BlockWidth)
66 }
67
68 static void bcsr(float * lump, const float * const val, const std::uint32_t * const col_ind, const std::uint32_t * const row_ptr, const Index rows, const int BlockHeight, const int BlockWidth)
69 {
70 BACKEND_SKELETON_VOID(bcsr_cuda, bcsr_generic, bcsr_generic, lump, val, col_ind, row_ptr, rows, BlockHeight, BlockWidth)
71 }
72
73 static void bcsr(double * lump, const double * const val, const std::uint32_t * const col_ind, const std::uint32_t * const row_ptr, const Index rows, const int BlockHeight, const int BlockWidth)
74 {
75 BACKEND_SKELETON_VOID(bcsr_cuda, bcsr_generic, bcsr_generic, lump, val, col_ind, row_ptr, rows, BlockHeight, BlockWidth)
76 }
77
78 template <typename DT_, typename IT_>
79 static void bcsr_generic(DT_* lump, const DT_* const val, const IT_* const col_ind, const IT_ * const row_ptr, const Index rows, const int BlockHeight, const int BlockWidth);
80
81 template <typename DT_, typename IT_>
82 static void csr_cuda(DT_ * lump, const DT_ * const val, const IT_ * const col_ind, const IT_ * const row_ptr, const Index rows);
83
84 template <typename DT_, typename IT_>
85 static void bcsr_cuda(DT_ * lump, const DT_ * const val, const IT_ * const col_ind, const IT_ * const row_ptr, const Index rows, const int BlockHeight, const int BlockWidth);
86 };
87
88#ifdef FEAT_EICKT
89 extern template void Lumping::csr_generic(float *, const float * const, const Index * const, const Index * const, const Index);
90 extern template void Lumping::csr_generic(double *, const double * const, const Index * const, const Index * const, const Index);
91
92 extern template void Lumping::bcsr_generic(float *, const float * const, const Index * const, const Index * const, const Index, const int, const int);
93 extern template void Lumping::bcsr_generic(double *, const double * const, const Index * const, const Index * const, const Index, const int, const int);
94#endif
95
96 } // namespace Arch
97 } // namespace LAFEM
98} // namespace FEAT
99
100#ifndef __CUDACC__
101#include <kernel/lafem/arch/lumping_generic.hpp>
102#endif
103#endif // KERNEL_LAFEM_ARCH_LUMPING_HPP
FEAT Kernel base header.
FEAT namespace.
Definition: adjactor.hpp:12
std::uint64_t Index
Index data type.