waLBerla 7.2
Loading...
Searching...
No Matches
walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T > Class Template Reference

Detailed Description

template<typename PdfField_T>
class walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >

Pack Info class template for lattice Boltzmann PDF fields.

Relies on a code-generated class providing kernel implementations for packing, unpacking and local copying of data.

This template relies on a PackingKernels implementation generated by lbmpy_walberla.packing_kernels. The code generated part provides the kernels for transferring data between communication buffers and fields. The iteration slices are constructed by this class.

The code-generated substructure enables the usage of arbitrary, in particular in-place streaming patterns.

Template Parameters
PackingKernels_TType of a PackingKernels implementation generated using lbmpy_walberla.generate_packing_kernels.

#include <UniformGeneratedGPUPdfPackInfo.h>

+ Inheritance diagram for walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >:

Public Types

using LatticeStorageSpecification_T = typename PdfField_T::LatticeStorageSpecification
 
using PackingKernels_T = typename LatticeStorageSpecification_T::PackKernels
 
using Stencil = typename LatticeStorageSpecification_T::Stencil
 

Public Member Functions

 UniformGeneratedGPUPdfPackInfo (const BlockDataID pdfFieldID, cell_idx_t cellLayersToSend=1, bool sendAll=false)
 
void pack (stencil::Direction dir, unsigned char *buffer, IBlock *block, gpuStream_t stream) override
 Pack data from a block into a send buffer.
 
void communicateLocal (stencil::Direction dir, const IBlock *sender, IBlock *receiver, gpuStream_t stream) override
 Copy data from one local block to another local block.
 
void unpack (stencil::Direction dir, unsigned char *buffer, IBlock *block, gpuStream_t stream) override
 Unpack data from a receive buffer into a block.
 
uint_t size (stencil::Direction dir, IBlock *block) override
 
- Public Member Functions inherited from walberla::gpu::GeneratedGPUPackInfo
 GeneratedGPUPackInfo ()=default
 
virtual ~GeneratedGPUPackInfo ()=default
 

Private Attributes

const BlockDataID pdfFieldID_
 
internal::UniformPackingGPUKernelsWrapper< PdfField_T, LatticeStorageSpecification_T::inplace > kernels_
 
cell_idx_t ghostLayersToSend_
 
bool sendAll_
 

Member Typedef Documentation

◆ LatticeStorageSpecification_T

template<typename PdfField_T >
using walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::LatticeStorageSpecification_T = typename PdfField_T::LatticeStorageSpecification

◆ PackingKernels_T

template<typename PdfField_T >
using walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::PackingKernels_T = typename LatticeStorageSpecification_T::PackKernels

◆ Stencil

template<typename PdfField_T >
using walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::Stencil = typename LatticeStorageSpecification_T::Stencil

Constructor & Destructor Documentation

◆ UniformGeneratedGPUPdfPackInfo()

template<typename PdfField_T >
walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::UniformGeneratedGPUPdfPackInfo ( const BlockDataID pdfFieldID,
cell_idx_t cellLayersToSend = 1,
bool sendAll = false )
inline

Member Function Documentation

◆ communicateLocal()

template<typename PdfField_T >
void walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::communicateLocal ( stencil::Direction dir,
const IBlock * sender,
IBlock * receiver,
gpuStream_t stream )
overridevirtual

Copy data from one local block to another local block.

Both blocks are allocated on the same MPI rank.

Parameters
dirthe direction of the communication (from sender to receiver)
senderid of block where the data should be copied from
receiverid of block where the data should be copied to
streamGPU stream

Implements walberla::gpu::GeneratedGPUPackInfo.

◆ pack()

template<typename PdfField_T >
void walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::pack ( stencil::Direction dir,
unsigned char * buffer,
IBlock * block,
gpuStream_t stream )
overridevirtual

Pack data from a block into a send buffer.

Parameters
dirpack data for neighbor in this direction
bufferbuffer for writing the data into
blockthe block whose data should be packed into a buffer
streamGPU stream

Implements walberla::gpu::GeneratedGPUPackInfo.

◆ size()

◆ unpack()

template<typename PdfField_T >
void walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::unpack ( stencil::Direction dir,
unsigned char * buffer,
IBlock * block,
gpuStream_t stream )
overridevirtual

Unpack data from a receive buffer into a block.

Parameters
dirreceive data from neighbor in this direction
bufferbuffer for reading the data from
blockthe block where the unpacked data should be stored into
streamGPU stream

Implements walberla::gpu::GeneratedGPUPackInfo.

Member Data Documentation

◆ ghostLayersToSend_

◆ kernels_

template<typename PdfField_T >
internal::UniformPackingGPUKernelsWrapper< PdfField_T, LatticeStorageSpecification_T::inplace > walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::kernels_
private

◆ pdfFieldID_

◆ sendAll_

template<typename PdfField_T >
bool walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >::sendAll_
private

The documentation for this class was generated from the following file: