ug4
algebra_template_define_helper.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015: G-CSC, Goethe University Frankfurt
3  * Author: Martin Rupp
4  *
5  * This file is part of UG4.
6  *
7  * UG4 is free software: you can redistribute it and/or modify it under the
8  * terms of the GNU Lesser General Public License version 3 (as published by the
9  * Free Software Foundation) with the following additional attribution
10  * requirements (according to LGPL/GPL v3 §7):
11  *
12  * (1) The following notice must be displayed in the Appropriate Legal Notices
13  * of covered and combined works: "Based on UG4 (www.ug4.org/license)".
14  *
15  * (2) The following notice must be displayed at a prominent place in the
16  * terminal output of covered works: "Based on UG4 (www.ug4.org/license)".
17  *
18  * (3) The following bibliography is recommended for citation and must be
19  * preserved in all covered files:
20  * "Reiter, S., Vogel, A., Heppner, I., Rupp, M., and Wittum, G. A massively
21  * parallel geometric multigrid solver on hierarchically distributed grids.
22  * Computing and visualization in science 16, 4 (2013), 151-164"
23  * "Vogel, A., Reiter, S., Rupp, M., Nägel, A., and Wittum, G. UG4 -- a novel
24  * flexible software system for simulating pde based models on high performance
25  * computers. Computing and visualization in science 16, 4 (2013), 165-179"
26  *
27  * This program is distributed in the hope that it will be useful,
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30  * GNU Lesser General Public License for more details.
31  */
32 
33 #ifndef ALGEBRA_TEMPLATE_DEFINE_HELPER_H_
34 #define ALGEBRA_TEMPLATE_DEFINE_HELPER_H_
35 
36 #include "cpu_algebra_types.h"
37 
38 #ifdef UG_CPU_1
39  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_1(TheTemplateClassType) \
40  template class TheTemplateClassType<ug::CPUAlgebra>;
41 #else
42  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_1(TheTemplateClassType)
43 #endif
44 
45 #ifdef UG_CPU_2
46  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_2(TheTemplateClassType) \
47  template class TheTemplateClassType<ug::CPUBlockAlgebra<2> >;
48 #else
49  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_2(TheTemplateClassType)
50 #endif
51 
52 #ifdef UG_CPU_3
53  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_3(TheTemplateClassType) \
54  template class TheTemplateClassType<ug::CPUBlockAlgebra<3> >;
55 #else
56  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_3(TheTemplateClassType)
57 #endif
58 
59 #ifdef UG_CPU_4
60  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_4(TheTemplateClassType) \
61  template class TheTemplateClassType<ug::CPUBlockAlgebra<4> >;
62 #else
63  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_4(TheTemplateClassType)
64 #endif
65 
66 #ifdef UG_CPU_5
67  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_5(TheTemplateClassType) \
68  template class TheTemplateClassType<ug::CPUBlockAlgebra<5> >;
69 #else
70  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_5(TheTemplateClassType)
71 #endif
72 
73 #ifdef UG_CPU_6
74  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_6(TheTemplateClassType) \
75  template class TheTemplateClassType<ug::CPUBlockAlgebra<6> >;
76 #else
77  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_6(TheTemplateClassType)
78 #endif
79 
80 #ifdef UG_CPU_VAR
81  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_VAR(TheTemplateClassType) \
82  template class TheTemplateClassType<ug::CPUVariableBlockAlgebra >;
83 #else
84  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_VAR(TheTemplateClassType)
85 #endif
86 
87 #ifdef UG_GPU
88  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_GPU(TheTemplateClassType) \
89  template class TheTemplateClassType<GPUAlgebra>;
90 #else
91  #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_GPU(TheTemplateClassType)
92 #endif
93 
105 #define UG_ALGEBRA_CPP_TEMPLATE_DEFINE_ALL(TheTemplateClassType) \
106  UG_ALGEBRA_CPP_TEMPLATE_DEFINE_1(TheTemplateClassType)\
107  UG_ALGEBRA_CPP_TEMPLATE_DEFINE_2(TheTemplateClassType) \
108  UG_ALGEBRA_CPP_TEMPLATE_DEFINE_3(TheTemplateClassType) \
109  UG_ALGEBRA_CPP_TEMPLATE_DEFINE_4(TheTemplateClassType) \
110  UG_ALGEBRA_CPP_TEMPLATE_DEFINE_5(TheTemplateClassType) \
111  UG_ALGEBRA_CPP_TEMPLATE_DEFINE_6(TheTemplateClassType) \
112  UG_ALGEBRA_CPP_TEMPLATE_DEFINE_VAR(TheTemplateClassType) \
113  UG_ALGEBRA_CPP_TEMPLATE_DEFINE_GPU(TheTemplateClassType)
114 
115 
116 #endif /* ALGEBRA_TEMPLATE_DEFINE_HELPER_H_ */