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

SumFac device kernels of the curl-curl operator: one element per thread, with the elements of a warp interleaved lane by lane. 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
 

Detailed Description

SumFac device kernels of the curl-curl operator: one element per thread, with the elements of a warp interleaved lane by lane.

Lane ilane of warp iwarp owns one element, and the block storage is interleaved at the warp size so the lanes of a warp read consecutive addresses. Each curl kernel contracts the one-dimensional derivative matrices itself over all components of its element and then applies, in the same pass, the collapsed-to-standard coordinate correction for simplex-type shapes, the geometric derivative factors and the curl.

The file provides, for each dimensionality: the per-element curl kernels (Curl2DScalarSumFacKernel and Curl2DVectorSumFacKernel in 2D, Curl3DSumFacKernel for both curls in 3D) and the device entry point the block operator launches (the CurlCurlKernelLauncher overload for that dimension), which unpacks the size parameter, stages any collapsed-coordinate tables in shared memory, walks the block's elements with a grid stride and calls the curl kernels twice per element – omega = curl u into the workspace, global or, when it fits, shared memory, then out = curl omega – so that the whole double curl is one fused launch. Curl3DH1KernelLauncher, launched with the planes of a multi-plane 3DH1 block on the second grid dimension, instead calls each 2D curl kernel once per element, for the plane part of a single curl, and needs no workspace. CurlCurlSharedMemorySize and CurlCurlWorkSpaceSize report how much dynamic shared memory and global workspace such a launch must request. The launchers and helpers are constrained to the SumFac implementation tag, so the identically named SumFacTOP ones in CurlCurlBlockOpDeviceSumFacTOPKernels.hpp are the ones that resolve when that tag is used instead.

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 CurlCurlBlockOpDeviceSumFacKernels.hpp.