waLBerla 7.3
Loading...
Searching...
No Matches

Detailed Description

Run an operation for every cell in the given interval.

The functions in this module iterate the given cell interval ci in x-fastest, z-slowest order and call func for every cell. The iteration is dispatched according to the given ExecutionTag:

  • exectag::Serial : Sequential iteration on the host.
  • exectag::OpenMP : Parallel iteration using OpenMP threads.
  • exectag::GPU : CUDA/HIP kernel exectuion with one GPU thread per cell in the given 'ci'. Launches the kernel asynchronously on the GPU stream specified by exTag (defaults to the default stream). Synchronization must be performed by the caller.

Functions

template<CellFunction Func>
void walberla::v8::sweep::forAllCells (const exectag::Serial &, const CellInterval &ci, Func &&func)
 Single-thread CPU cellwise kernel dispatcher.
template<CellFunction Func>
void walberla::v8::sweep::forAllCells (const exectag::OpenMP &, const CellInterval &ci, Func &&func)
 Multi-threaded CPU cellwise kernel dispatcher using OpenMP.
template<CellFunction Func>
void walberla::v8::sweep::forAllCells (const exectag::GPU &, const CellInterval &, Func &&)
 GPU-accelerated kernel dispatcher.

Function Documentation

◆ forAllCells() [1/3]

template<CellFunction Func>
void walberla::v8::sweep::forAllCells ( const exectag::GPU & ,
const CellInterval & ,
Func &&  )

GPU-accelerated kernel dispatcher.

Execute a cellwise kernel function on all cells of a given interval in parallel on the GPU

Warning
Only available if CUDA or HIP are enabled

◆ forAllCells() [2/3]

template<CellFunction Func>
void walberla::v8::sweep::forAllCells ( const exectag::OpenMP & ,
const CellInterval & ci,
Func && func )

Multi-threaded CPU cellwise kernel dispatcher using OpenMP.

Execute a cellwise kernel function on all cells of a given interval in parallel on the CPU using OpenMP.

Warning
If OpenMP is not enabled in waLBerla's build configuration, falls back to sequential iteration.

◆ forAllCells() [3/3]

template<CellFunction Func>
void walberla::v8::sweep::forAllCells ( const exectag::Serial & ,
const CellInterval & ci,
Func && func )

Single-thread CPU cellwise kernel dispatcher.

Execute a cellwise kernel function on all cells of a given interval in sequence on the CPU.