Skip to content

Commit bc995bf

Browse files
github annotations
- `kernelEvents.*`: add exec namespace - fix typos
1 parent b485c21 commit bc995bf

File tree

3 files changed

+51
-46
lines changed

3 files changed

+51
-46
lines changed

src/libPMacc/include/eventSystem/events/kernelEvents.hpp

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,27 @@
4848

4949

5050
namespace PMacc
51+
{
52+
namespace exec
5153
{
5254
/** configured kernel object
53-
*
55+
*
5456
* this objects contains the functor and the starting parameter
55-
*
57+
*
5658
* @tparam T_Kernel pmacc Kernel object
57-
* @tparam T_VectorGrid type which defines the grid extents (type must be cast able to CUDA dim3)
58-
* @tparam T_VectorBlock type which defines the block extents (type must be cast able to CUDA dim3)
59+
* @tparam T_VectorGrid type which defines the grid extents (type must be castable to CUDA dim3)
60+
* @tparam T_VectorBlock type which defines the block extents (type must be castable to CUDA dim3)
5961
*/
6062
template<
6163
typename T_Kernel,
6264
typename T_VectorGrid,
6365
typename T_VectorBlock
6466
>
6567
struct KernelStarter;
66-
68+
6769
/** wrapper for the user kernel functor
68-
*
69-
* contains debug information like filename and lien of the kernel call
70+
*
71+
* contains debug information like filename and line of the kernel call
7072
*/
7173
template< typename T_KernelFunctor >
7274
struct Kernel
@@ -79,11 +81,11 @@ namespace PMacc
7981
size_t const m_line;
8082

8183
/**
82-
*
84+
*
8385
* @param gridExtent grid extent configuration for the kernel
84-
* @param blockExtent block extent configuration for the kernel
86+
* @param blockExtent block extent configuration for the kernel
8587
* @param sharedMemByte dynamic shared memory used by the kernel (in byte )
86-
* @return
88+
* @return
8789
*/
8890
HINLINE Kernel(
8991
T_KernelFunctor const & kernelFunctor,
@@ -98,15 +100,15 @@ namespace PMacc
98100
}
99101

100102
/** configured kernel object
101-
*
103+
*
102104
* this objects contains the functor and the starting parameter
103-
*
104-
* @tparam T_VectorGrid type which defines the grid extents (type must be cast able to CUDA dim3)
105-
* @tparam T_VectorBlock type which defines the block extents (type must be cast able to CUDA dim3)
106-
*
105+
*
106+
* @tparam T_VectorGrid type which defines the grid extents (type must be castable to CUDA dim3)
107+
* @tparam T_VectorBlock type which defines the block extents (type must be castable to CUDA dim3)
108+
*
107109
* @param gridExtent grid extent configuration for the kernel
108-
* @param blockExtent block extent configuration for the kernel
109-
* @param sharedMemByte dynamic shared memory used by the kernel (in byte )
110+
* @param blockExtent block extent configuration for the kernel
111+
* @param sharedMemByte dynamic shared memory used by the kernel (in byte)
110112
*/
111113
template<
112114
typename T_VectorGrid,
@@ -119,15 +121,15 @@ namespace PMacc
119121
T_VectorBlock const & blockExtent,
120122
size_t const sharedMemByte = 0
121123
) const
122-
-> KernelStarter<
124+
-> KernelStarter<
123125
Kernel,
124126
T_VectorGrid,
125127
T_VectorBlock
126128
>;
127129
};
128130

129131

130-
template<
132+
template<
131133
typename T_Kernel,
132134
typename T_VectorGrid,
133135
typename T_VectorBlock
@@ -140,11 +142,11 @@ namespace PMacc
140142
T_VectorGrid const m_gridExtent;
141143
/** block extents for the kernel */
142144
T_VectorBlock const m_blockExtent;
143-
/** dynamic shared memory consumed by the kernel (in byte)*/
145+
/** dynamic shared memory consumed by the kernel (in byte) */
144146
size_t const m_sharedMemByte;
145147

146148
/** kernel starter object
147-
*
149+
*
148150
* @param kernel pmacc Kernel
149151
*/
150152
HINLINE KernelStarter(
@@ -162,10 +164,10 @@ namespace PMacc
162164
}
163165

164166
/** execute the kernel functor
165-
*
167+
*
166168
* @tparam T_Args types of the arguments
167169
* @param args arguments for the kernel functor
168-
*
170+
*
169171
* @{
170172
*/
171173
template<
@@ -180,8 +182,8 @@ namespace PMacc
180182

181183
std::string const kernelName = typeid( m_kernel.m_kernelFunctor ).name();
182184
std::string const kernelInfo = kernelName +
183-
std::string( " [" ) + m_kernel.m_file + std::string( ":" ) +
184-
std::to_string( m_kernel.m_line ) + std::string( " ]" );
185+
std::string( " [" ) + m_kernel.m_file + std::string( ":" ) +
186+
std::to_string( m_kernel.m_line ) + std::string( " ]" );
185187

186188
CUDA_CHECK_KERNEL_MSG(
187189
cudaDeviceSynchronize( ),
@@ -197,21 +199,21 @@ namespace PMacc
197199
T_VectorGrid
198200
>::value
199201
> gridExtent( m_gridExtent );
200-
202+
201203
DataSpace<
202204
traits::GetNComponents<
203205
T_VectorBlock
204206
>::value
205207
> blockExtent( m_blockExtent );
206-
208+
207209
nvidia::gpuEntryFunction<<<
208210
gridExtent,
209211
blockExtent,
210212
m_sharedMemByte,
211213
taskKernel->getCudaStream()
212-
>>>(
213-
m_kernel.m_kernelFunctor,
214-
args ...
214+
>>>(
215+
m_kernel.m_kernelFunctor,
216+
args ...
215217
);
216218
CUDA_CHECK_KERNEL_MSG(
217219
cudaGetLastError( ),
@@ -227,26 +229,26 @@ namespace PMacc
227229
std::string( "Crash after kernel activation" ) + kernelInfo
228230
);
229231
}
230-
232+
231233
template<
232234
typename ... T_Args
233235
>
234236
HINLINE
235237
void
236238
operator()(
237239
T_Args const &... args
238-
)
240+
)
239241
{
240242
return static_cast< const KernelStarter >(*this)( args ... );
241243
}
242-
244+
243245
/** @} */
244246

245247
};
246248

247249

248250
/** creates a kernel object
249-
*
251+
*
250252
* @tparam T_KernelFunctor type of the kernel functor
251253
* @param kernelFunctor instance of the functor
252254
* @param file file name (for debug)
@@ -257,32 +259,32 @@ namespace PMacc
257259
T_KernelFunctor const & kernelFunctor,
258260
std::string const & file = std::string(),
259261
size_t const line = 0
260-
) -> PMacc::Kernel< T_KernelFunctor >
262+
) -> Kernel< T_KernelFunctor >
261263
{
262-
return PMacc::Kernel< T_KernelFunctor >(
264+
return Kernel< T_KernelFunctor >(
263265
kernelFunctor,
264266
file,
265267
line
266268
);
267269
}
268-
270+
} // namespace exec
269271
} // namespace PMacc
270272

271273

272274
/** create a kernel object out of a functor instance
273-
*
275+
*
274276
* this macro add the current filename and line number to the kernel object
275-
*
277+
*
276278
* @param ... instance of kernel functor
277279
*/
278-
#define PMACC_KERNEL( ... ) PMacc::kernel( __VA_ARGS__, __FILE__, static_cast< size_t >( __LINE__ ) )
280+
#define PMACC_KERNEL( ... ) PMacc::exec::kernel( __VA_ARGS__, __FILE__, static_cast< size_t >( __LINE__ ) )
279281

280282
/** create a kernel object out of a functor type name
281-
*
283+
*
282284
* this macro add the current filename and line number to the kernel object
283-
*
284-
* @param ... type of the kernel functor
285-
*/
286-
#define PMACC_TYPEKERNEL( ... ) PMacc::kernel( __VA_ARGS__{}, __FILE__, static_cast< size_t >( __LINE__ ) )
285+
*
286+
* @param ... type of the kernel functor
287+
*/
288+
#define PMACC_TYPEKERNEL( ... ) PMacc::exec::kernel( __VA_ARGS__{}, __FILE__, static_cast< size_t >( __LINE__ ) )
287289

288290
#include "eventSystem/events/kernelEvents.tpp"

src/libPMacc/include/eventSystem/events/kernelEvents.tpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828

2929

3030
namespace PMacc
31+
{
32+
namespace exec
3133
{
3234
template< typename T_KernelFunctor >
3335
template<
@@ -58,4 +60,5 @@ namespace PMacc
5860
sharedMemByte
5961
);
6062
}
63+
} // namespace exec
6164
} // namespace PMacc

src/libPMacc/include/pmacc_types.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ typedef long long int int64_cu;
7373
# define PMACC_CUDA_ARCH __CUDA_ARCH__
7474
#endif
7575

76-
/** pmacc global identifier for CUDA kernel */
76+
/** PMacc global identifier for CUDA kernel */
7777
#define PMACC_GLOBAL_KEYWORD __location__(global)
7878

7979
/*

0 commit comments

Comments
 (0)