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 ) {
});
}
Definition ParallelStreams.h:34
void run(const std::function< void(gpuStream_t)> &f)
Definition ParallelStreams.cpp:67
Helper class to run CUDA/HIP operations on parallel streams.
Definition ParallelStreams.h:82
ParallelSection parallelSection(gpuStream_t stream)
Definition ParallelStreams.cpp:103