|
Nektar++
|
SumFac device kernel launchers of the block divergence – one element per thread – together with their shared-memory sizing helpers. More...
#include <LibUtilities/Backends/Backends_Device_API.hpp>#include <LibUtilities/Backends/DeviceProperties.hpp>#include <LibUtilities/BasicUtils/ShapeType.hpp>#include <MultiRegions/ElmtOps/PhysDeriv/PhysDerivBlockOpDeviceSumFacKernels.hpp>Go to the source code of this file.
Namespaces | |
| namespace | Nektar |
| namespace | Nektar::MultiRegions |
| namespace | Nektar::MultiRegions::detail |
SumFac device kernel launchers of the block divergence – one element per thread – together with their shared-memory sizing helpers.
The DivergenceKernelLauncher overloads of this file, one per dimension, write \(\sum_c \partial u_c/\partial x_c\) to the output. In 1D that is PhysDerivDir1DSumFacKernel (PhysDeriv/PhysDerivBlockOpDeviceSumFacKernels.hpp, included here). In 2D and 3D, Divergence{2,3}DSumFacKernel differentiate every component in every reference direction at a point, apply the collapsed-coordinate correction where the shape requires it, contract each component with its own row of the derivative factors and store the sum once, so the output is written once per point. DivergenceSharedMemorySize reports how much dynamic shared memory a launch must request.
Each thread owns one element: element e is handled by lane e % warpSize of warp e / warpSize, matching the warp-interleaved block storage the host side reshapes to, and the kernels grid-stride over the elements left after the first pass (padding elements included – their results are ignored). The homogeneous planes ride the second grid dimension: each thread block offsets the input and output to the plane given by its second block index, all planes sharing the derivative factors. The launchers are constrained to the SumFac implementation tag, so the identically named SumFacTOP launchers in DivergenceBlockOpDeviceSumFacTOPKernels.hpp are the ones that resolve when that tag is used instead. The whole file is compiled only for the device back-ends (NEKTAR_ENABLE_DEVICE together with DEVICE_COMPILE_ONLY).
Definition in file DivergenceBlockOpDeviceSumFacKernels.hpp.