|
Nektar++
|
SumFacTOP device kernel launchers of the block divergence – one element, or a group of them, per thread block at a time – 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/PhysDerivBlockOpDeviceSumFacTOPKernels.hpp>Go to the source code of this file.
Namespaces | |
| namespace | Nektar |
| namespace | Nektar::MultiRegions |
| namespace | Nektar::MultiRegions::detail |
SumFacTOP device kernel launchers of the block divergence – one element, or a group of them, per thread block at a time – together with their shared-memory sizing helpers.
The kernels compute the same quantity as their SumFac counterparts (see DivergenceBlockOpDeviceSumFacKernels.hpp) and are assembled from the same PhysDeriv building blocks, here the SumFacTOP forms PhysDerivDir1DSumFacTOPKernel<APPEND, DEFORMED, DIR> and PhysDerivDir{2,3}DSumFacTOPKernel<SHAPE_TYPE, APPEND, DEFORMED, DIR> from PhysDeriv/PhysDerivBlockOpDeviceSumFacTOPKernels.hpp: per component, all reference-direction derivatives are formed, corrected for a collapsed coordinate where the shape requires it, and contracted with row DIR of the derivative factors, overwriting the running sum for the first component and accumulating onto it for the others.
The parallelisation differs: one element, or a group of them (GetDeviceElmtBlock()), is assigned to a whole thread block, whose threads stride over each element's quadrature points, and the blocks stride over the element groups of the block of elements (padding included). The homogeneous planes ride the second grid dimension, each thread block offsetting the input and output to the plane given by its second block index, all planes sharing the derivative factors. In two and three dimensions, where they fit, the component being differentiated and the running sum are staged in two shared-memory workspaces, the sum being written out once all components have been added; the PhysDerivDir SumFacTOP kernels close with a barrier, so the next component may be copied in immediately afterwards. Otherwise each component is read in place and the sum accumulated directly in the output. Element data is expected contiguous (interleave width one) and the derivative factors in the factor-major layout, which is what DivergenceBlockOpImpl::m_implInterleaveWidth and its DerivFactorKey request for this strategy. The DivergenceKernelLauncher overloads are constrained to the SumFacTOP implementation tag and are otherwise identical in name and signature to the SumFac ones, which is how DivergenceBlockOpImpl::OperatorNDImpl can launch either strategy from one call site; DivergenceSharedMemorySize reports how much dynamic shared memory such a launch must request.
The whole file is compiled only for the device back-ends (NEKTAR_ENABLE_DEVICE together with DEVICE_COMPILE_ONLY).
Definition in file DivergenceBlockOpDeviceSumFacTOPKernels.hpp.