33
33
#define PMACC_USING_STATIC_CONST_VECTOR_NAMESPACE (id ) using namespace PMACC_JOIN ( pmacc_static_const_vector_host,id)
34
34
#endif
35
35
36
- /* * @see PMACC_CONST_VECTOR documentation, only unique "id" is added
36
+ /* * define a const vector
37
+ *
38
+ * create type definition `Name_t`
39
+ * @see PMACC_CONST_VECTOR documentation, only unique "id" is added
37
40
*
38
41
* @param id unique precompiler id to create unique namespaces
39
42
*/
40
- #define PMACC_STATIC_CONST_VECTOR_DIM (id,Name,Type,Dim,count,...) \
43
+ #define PMACC_STATIC_CONST_VECTOR_DIM_DEF (id,Name,Type,Dim,count,...) \
41
44
namespace PMACC_JOIN ( pmacc_static_const_storage,id) \
42
45
{ \
43
46
namespace PMACC_JOIN ( pmacc_static_const_vector_device,id) \
@@ -64,7 +67,7 @@ namespace PMACC_JOIN(pmacc_static_const_storage,id) \
64
67
} \
65
68
HDINLINE const type& operator [](const int idx) const \
66
69
{ \
67
- /* access const C array with the name of array*/ \
70
+ /* access const C array with the name of array*/ \
68
71
return PMACC_JOIN (Name,_data)[idx]; \
69
72
} \
70
73
}; \
@@ -75,6 +78,14 @@ namespace PMACC_JOIN(pmacc_static_const_storage,id) \
75
78
PMacc::math::StandartAccessor, \
76
79
PMacc::math::StandartNavigator, \
77
80
ConstArrayStorage > PMACC_JOIN (Name,_t); \
81
+ } /* namespace pmacc_static_const_storage + id */ \
82
+ using namespace PMACC_JOIN ( pmacc_static_const_storage,id)
83
+
84
+ /* * create a instance of type `Name_t` with the name `Name`
85
+ */
86
+ #define PMACC_STATIC_CONST_VECTOR_DIM_INSTANCE (id,Name,Type,Dim,count,...) \
87
+ namespace PMACC_JOIN ( pmacc_static_const_storage,id) \
88
+ { \
78
89
namespace PMACC_JOIN ( pmacc_static_const_vector_device,id) \
79
90
{ \
80
91
/* create const instance on device */ \
@@ -85,10 +96,26 @@ namespace PMACC_JOIN(pmacc_static_const_storage,id) \
85
96
/* create const instance on host*/ \
86
97
const PMACC_JOIN (Name,_t) Name; \
87
98
} /* namespace pmacc_static_const_vector_host + id */ \
88
- } /* namespace pmacc_static_const_storage + id */ \
89
- using namespace PMACC_JOIN ( pmacc_static_const_storage,id)
99
+ } /* namespace pmacc_static_const_storage + id */
100
+
101
+ /* * @see PMACC_CONST_VECTOR documentation, only unique "id" is added
102
+ *
103
+ * @param id unique precompiler id to create unique namespaces
104
+ */
105
+ #define PMACC_STATIC_CONST_VECTOR_DIM (id,Name,Type,Dim,count,...) \
106
+ PMACC_STATIC_CONST_VECTOR_DIM_DEF (id,Name,Type,Dim,count,__VA_ARGS__); \
107
+ PMACC_STATIC_CONST_VECTOR_DIM_INSTANCE (id,Name,Type,Dim,count,__VA_ARGS__)
90
108
91
109
110
+ /* * define a const vector
111
+ *
112
+ * for description @see PMACC_CONST_VECTOR
113
+ *
114
+ * create type definition `name_t`
115
+ */
116
+ #define PMACC_CONST_VECTOR_DEF (type,dim,name,...) \
117
+ PMACC_STATIC_CONST_VECTOR_DIM_DEF (__COUNTER__,name,type,dim,PMACC_COUNT_ARGS(__VA_ARGS__),__VA_ARGS__)
118
+
92
119
/* * Create global constant math::Vector with compile time values which can be
93
120
* used on device and host
94
121
*
@@ -107,4 +134,3 @@ using namespace PMACC_JOIN(pmacc_static_const_storage,id)
107
134
*/
108
135
#define PMACC_CONST_VECTOR (type,dim,name,...) \
109
136
PMACC_STATIC_CONST_VECTOR_DIM (__COUNTER__,name,type,dim,PMACC_COUNT_ARGS(__VA_ARGS__),__VA_ARGS__)
110
-
0 commit comments