Helper class to run CUDA/HIP operations on parallel streams.
This class introduces "side streams" that overlap with one "main stream". In a parallel section, multiple kernels (or other CUDA/HIP operations) are scheduled to the streams. The first "run" is scheduled on the main stream all subsequent operations on the side streams. The passed priority affects only the side streams. When the parallel section goes out of scope the side streams are synchronized to the main stream via CUDA/HIP events.
Example:
{
sec.
run([&] ( gpuStream_t sideStream ) {
});
}
void run(const std::function< void(gpuStream_t)> &f)
Definition ParallelStreams.cpp:67
ParallelSection parallelSection(gpuStream_t stream)
Definition ParallelStreams.cpp:103
friend class ParallelSection
Definition ParallelStreams.h:89
ParallelStreams(int priority=0)
Definition ParallelStreams.cpp:98
#include <ParallelStreams.h>
◆ ParallelStreams()
| walberla::gpu::ParallelStreams::ParallelStreams |
( |
int | priority = 0 | ) |
|
◆ ensureSize()
| void walberla::gpu::ParallelStreams::ensureSize |
( |
uint_t | size | ) |
|
|
private |
◆ parallelSection()
| ParallelSection walberla::gpu::ParallelStreams::parallelSection |
( |
gpuStream_t | stream | ) |
|
◆ setStreamPriority()
| void walberla::gpu::ParallelStreams::setStreamPriority |
( |
int | priority | ) |
|
◆ ParallelSection
| friend class ParallelSection |
|
friend |
◆ events_
| std::vector<EventRAII> walberla::gpu::ParallelStreams::events_ |
|
private |
◆ mainEvent_
| EventRAII walberla::gpu::ParallelStreams::mainEvent_ |
|
private |
◆ sideStreams_
| std::vector<StreamRAII> walberla::gpu::ParallelStreams::sideStreams_ |
|
private |
◆ streamPriority_
| int walberla::gpu::ParallelStreams::streamPriority_ |
|
private |
The documentation for this class was generated from the following files: