|
Nektar++
|
Device SumFac kernels of the mass operator: one element per thread, the two composed families' shape kernels run back to back, with the intermediates in a global-memory workspace or, when it fits, in shared memory. More...
#include <LibUtilities/Backends/Backends_Device_API.hpp>#include <LibUtilities/Backends/DeviceProperties.hpp>#include <LibUtilities/BasicUtils/ShapeType.hpp>#include <MultiRegions/ElmtOps/BwdTrans/BwdTransBlockOpDeviceSumFacKernels.hpp>#include <MultiRegions/ElmtOps/IProductWRTBase/IProductWRTBaseBlockOpDeviceSumFacKernels.hpp>Go to the source code of this file.
Namespaces | |
| namespace | Nektar |
| namespace | Nektar::MultiRegions |
| namespace | Nektar::MultiRegions::detail |
Device SumFac kernels of the mass operator: one element per thread, the two composed families' shape kernels run back to back, with the intermediates in a global-memory workspace or, when it fits, in shared memory.
These are the kernels the Device/SumFac block implementation launches (see MassBlockOpDeviceSumFac.hpp); the SumFacTOP counterparts, where a whole thread block cooperates on one element, are in MassBlockOpDeviceSumFacTOPKernels.hpp. Everything below is compiled only into device translation units of a device-enabled build (NEKTAR_ENABLE_DEVICE and DEVICE_COMPILE_ONLY).
The MassKernelLauncher overloads own no mathematics of their own. Each grid-strides over the block's elements, and for its element calls the BwdTrans shape kernel of BwdTransBlockOpDeviceSumFacKernels.hpp followed by the IProductWRTBase shape kernel of IProductWRTBaseBlockOpDeviceSumFacKernels.hpp, the transform instantiated with APPEND false and the inner product with the launcher's SCALE and APPEND and given its scale; the transform kernels have no SCALE parameter and take no scale argument. The quadrature weights and the Jacobian therefore enter exactly where they do in a standalone inner product: inside the IProductWRTBase shape kernel, which receives the per-direction weight tables and the warp's Jacobian slice and whose DEFORMED parameter decides whether that slice holds one value per element or one per quadrature point. For the nodal shapes the element's coefficients are mapped to the modal basis by MatVecKernel before the transform and mapped back by the same kernel with TRANSPOSE set afterwards; there the inner product overwrites the modal slice and APPEND governs the mapping back.
Element data is interleaved at the warp size: lane e % warpsize of warp e / warpsize owns element e, and every workspace slice is addressed by warp, so a shape kernel writes value k of its element at offset warpsize * k + ilane. One launch covers every component of the block: the grid's second dimension is the component count, a thread's own component c comes from getBlockIdx<1>, and in, out and every workspace region span all components back to back, a component's share starting at element index nelmt * c, ahead of the warp interleaving above. With useSharedMemoryWsp the workspace regions are instead those of the thread block's single warp in shared memory, laid out as MassWorkSpaceSize gives for warpSize elements.
This file also provides the SumFac overloads of the two launch-size queries the block implementation calls, MassWorkSpaceSize and MassSharedMemorySize; the SumFacTOP overloads of the same names live in MassBlockOpDeviceSumFacTOPKernels.hpp.
Definition in file MassBlockOpDeviceSumFacKernels.hpp.