waLBerla 7.2
Loading...
Searching...
No Matches
walberla::gpu::GeneratedGPUPackInfo Class Referenceabstract

Detailed Description

Data packing/unpacking for ghost layer based communication of a GPUField.

Encapsulate information on how to extract data from blocks that should be communicated to neighboring blocks (see pack()) and how to inject this data in a receiving block (see unpack()). This involves a memory buffer and two memory copy operations.

A special method exists for communication between two blocks which are allocated on the same process (see communicateLocal()). In this case the data does not have be communicated via a buffer, but can be copied directly.

Data that is packed in direction "dir" at one block is unpacked in direction "stencil::inverseDir[dir]" at the neighboring block. This behavior must be implemented in communicateLocal()!

#include <GeneratedGPUPackInfo.h>

+ Inheritance diagram for walberla::gpu::GeneratedGPUPackInfo:

Public Member Functions

 GeneratedGPUPackInfo ()=default
 
virtual ~GeneratedGPUPackInfo ()=default
 
virtual void pack (stencil::Direction dir, unsigned char *buffer, IBlock *block, gpuStream_t stream)=0
 Pack data from a block into a send buffer.
 
virtual void communicateLocal (stencil::Direction dir, const IBlock *sender, IBlock *receiver, gpuStream_t stream)=0
 Copy data from one local block to another local block.
 
virtual void unpack (stencil::Direction dir, unsigned char *buffer, IBlock *block, gpuStream_t stream)=0
 Unpack data from a receive buffer into a block.
 
virtual uint_t size (stencil::Direction dir, IBlock *block)=0
 

Constructor & Destructor Documentation

◆ GeneratedGPUPackInfo()

walberla::gpu::GeneratedGPUPackInfo::GeneratedGPUPackInfo ( )
default

◆ ~GeneratedGPUPackInfo()

virtual walberla::gpu::GeneratedGPUPackInfo::~GeneratedGPUPackInfo ( )
virtualdefault

Member Function Documentation

◆ communicateLocal()

virtual void walberla::gpu::GeneratedGPUPackInfo::communicateLocal ( stencil::Direction dir,
const IBlock * sender,
IBlock * receiver,
gpuStream_t stream )
pure virtual

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

Implemented in walberla::gpu::communication::MemcpyPackInfo< GPUFieldType >, and walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >.

◆ pack()

virtual void walberla::gpu::GeneratedGPUPackInfo::pack ( stencil::Direction dir,
unsigned char * buffer,
IBlock * block,
gpuStream_t stream )
pure virtual

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

Implemented in walberla::gpu::communication::MemcpyPackInfo< GPUFieldType >, walberla::lbm::CombinedInPlaceGpuPackInfo< EvenPackInfo, OddPackInfo >, and walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >.

◆ size()

◆ unpack()

virtual void walberla::gpu::GeneratedGPUPackInfo::unpack ( stencil::Direction dir,
unsigned char * buffer,
IBlock * block,
gpuStream_t stream )
pure virtual

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

Implemented in walberla::gpu::communication::MemcpyPackInfo< GPUFieldType >, walberla::lbm::CombinedInPlaceGpuPackInfo< EvenPackInfo, OddPackInfo >, and walberla::lbm_generated::UniformGeneratedGPUPdfPackInfo< PdfField_T >.


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