Nektar++
Loading...
Searching...
No Matches
Namespaces
AdvectionBlockOpDeviceSumFacTOPKernels.hpp File Reference

SumFacTOP device kernels of the advection operator: one element, or a group of them, at a time per thread block, threads indexed over the element's quadrature points. More...

#include <LibUtilities/Backends/Backends_Device_API.hpp>
#include <LibUtilities/Backends/DeviceProperties.hpp>
#include <LibUtilities/BasicUtils/ShapeType.hpp>
#include <LibUtilities/BasicUtils/Utils/UtilsDeviceKernels.hpp>
#include <MultiRegions/ElmtOps/ElmtHelper.hpp>

Go to the source code of this file.

Namespaces

namespace  Nektar
 
namespace  Nektar::MultiRegions
 
namespace  Nektar::MultiRegions::detail
 

Detailed Description

SumFacTOP device kernels of the advection operator: one element, or a group of them, at a time per thread block, threads indexed over the element's quadrature points.

These kernels compute the same thing as the SumFac ones in AdvectionBlockOpDeviceSumFacKernels.hpp – the tensor-direction derivatives, the collapsed-to-standard coordinate correction, the geometric derivative factors and the dot product with the advection velocity – but distribute the work differently. A whole thread block takes one element, or a group of them (GetDeviceElmtBlock()), at a time and the threads of each element stride over its quadrature points, each thread computing the output at the points it owns. In two and three dimensions the element's input values are staged in shared memory first when they fit, so that the tensor contractions, which read across the element, hit shared rather than global memory, and are otherwise read in place; the derivative factors and the velocity stay in global memory and are read at the thread's own point index, the collapsed-coordinate tables at the direction indices that point resolves into. Accordingly the data is not interleaved (one element's values are contiguous) and the derivative factors are taken in the transposed layout, with each factor component contiguous over the element's points.

The file provides, for each dimensionality: the per-element kernel (Advection*DSumFacTOPKernel) and the device entry point the block operator launches (the AdvectionKernelLauncher overload for that dimension), which unpacks the size parameter and walks the block's elements one thread block at a time, one grid row per component or homogeneous mode, staging each element's input in shared memory in two and three dimensions, when it fits, before calling the per-element kernel. AdvectionSharedMemorySize reports how much dynamic shared memory such a launch must request. The launchers are constrained to the SumFacTOP implementation tag and are otherwise identical in name and signature to the SumFac ones, which is how AdvectionBlockOpImpl::OperatorNDImpl can launch either strategy from one call site.

Everything in the namespace is guarded by NEKTAR_ENABLE_DEVICE and DEVICE_COMPILE_ONLY, so it exists only in translation units compiled for a device back-end.

Definition in file AdvectionBlockOpDeviceSumFacTOPKernels.hpp.