|
Nektar++
|
SumFacTOP device kernels of the mass operator: the threads of one device block cooperate on one element, or a group of them, at a time, with the intermediates staged 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/BwdTransBlockOpDeviceSumFacTOPKernels.hpp>#include <MultiRegions/ElmtOps/IProductWRTBase/IProductWRTBaseBlockOpDeviceSumFacTOPKernels.hpp>Go to the source code of this file.
Namespaces | |
| namespace | Nektar |
| namespace | Nektar::MultiRegions |
| namespace | Nektar::MultiRegions::detail |
SumFacTOP device kernels of the mass operator: the threads of one device block cooperate on one element, or a group of them, at a time, with the intermediates staged in shared memory.
These are the kernels the Device/SumFacTOP block implementation launches (see MassBlockOpDeviceSumFac.hpp); the SumFac counterparts, with one element per thread, are in MassBlockOpDeviceSumFacKernels.hpp. Everything below is compiled only into device translation units of a device-enabled build (NEKTAR_ENABLE_DEVICE and DEVICE_COMPILE_ONLY).
The 2D and 3D MassKernelLauncher overloads first stage the per-direction basis tables in shared memory once for the whole thread block, then stride their blocks over the elements. For each element they stage the coefficients (or, for a nodal shape, their modal image), call the BwdTrans shape kernel of BwdTransBlockOpDeviceSumFacTOPKernels.hpp, and call the IProductWRTBase shape kernel of IProductWRTBaseBlockOpDeviceSumFacTOPKernels.hpp, the transform with APPEND false and the inner product with the launcher's SCALE and APPEND; for a nodal shape the inner product overwrites the modal slice and APPEND governs the mapping back. The 1D overload stages only the physical values passed between the two stages: it hands the basis table, the coefficients and the output to the segment kernels straight from global memory.
Unlike the SumFac kernels, which hand the weights and the Jacobian to the inner-product shape kernel, the kernels here apply the whole quadrature metric themselves, in a thread-strided loop over the element's quadrature points between the two stages: each staged physical value is multiplied by the tensor product of the per-direction weights and by the element Jacobian (one value per element, or one per point when DEFORMED), and a barrier follows before the inner product reads them. The IProductWRTBase shape kernels are therefore called in their metric-free form, the one that expects its input to carry the metric already.
The basis tables always go in shared memory. The per-element regions – the coefficients, the physical values and the stage scratch – form the workspace: with useSharedMemoryWsp in shared memory after the basis data, aligned, row-padded and with a padded inner-product input of its own (MassSharedWorkSpaceSize), else packed and unpadded in the thread block's slice of the global-memory workspace (MassWorkSpaceSize). MassSharedMemorySize returns what the shared staging costs.
Definition in file MassBlockOpDeviceSumFacTOPKernels.hpp.