OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::ConcreteCommunicatable< gpu::cuda::Column< T > > Class Template Referencefinal

Communicatable implementation for a single gpu::cuda::Column. More...

#include <column.h>

+ Inheritance diagram for olb::ConcreteCommunicatable< gpu::cuda::Column< T > >:
+ Collaboration diagram for olb::ConcreteCommunicatable< gpu::cuda::Column< T > >:

Public Member Functions

 ConcreteCommunicatable (gpu::cuda::Column< T > &column)
 
std::size_t size (ConstSpan< CellID > indices) const
 Get serialized size for data at locations indices
 
std::size_t serialize (ConstSpan< CellID > indices, std::uint8_t *buffer) const
 Serialize data at locations indices to buffer
 
std::size_t deserialize (ConstSpan< CellID > indices, const std::uint8_t *buffer)
 Deserialize data at locations indices to buffer
 
- Public Member Functions inherited from olb::Communicatable
virtual ~Communicatable ()
 

Detailed Description

template<typename T>
class olb::ConcreteCommunicatable< gpu::cuda::Column< T > >

Communicatable implementation for a single gpu::cuda::Column.

This is only implemented to match the interface of CPU communication. The actual communication buffers for communicating block lattice data are handled using custom kernel functions in the the Platform::GPU_CUDA specialization of ConcreteBlockCommunicator.

Definition at line 199 of file column.h.

Constructor & Destructor Documentation

◆ ConcreteCommunicatable()

template<typename T >
olb::ConcreteCommunicatable< gpu::cuda::Column< T > >::ConcreteCommunicatable ( gpu::cuda::Column< T > & column)
inline

Definition at line 204 of file column.h.

204 :
205 _column{column} { }

Member Function Documentation

◆ deserialize()

template<typename T >
std::size_t olb::ConcreteCommunicatable< gpu::cuda::Column< T > >::deserialize ( ConstSpan< CellID > indices,
const std::uint8_t * buffer )
virtual

Deserialize data at locations indices to buffer

Implements olb::Communicatable.

Definition at line 342 of file column.hh.

344{
345 thrust::scatter(thrust::device,
346 thrust::device_pointer_cast(reinterpret_cast<const T*>(buffer)),
347 thrust::device_pointer_cast(reinterpret_cast<const T*>(buffer) + indices.size()),
348 thrust::device_pointer_cast(indices.begin()),
349 thrust::device_pointer_cast(_column.deviceData()));
350 return indices.size() * sizeof(T);
351}

References olb::ConstSpan< T >::begin(), and olb::ConstSpan< T >::size().

+ Here is the call graph for this function:

◆ serialize()

template<typename T >
std::size_t olb::ConcreteCommunicatable< gpu::cuda::Column< T > >::serialize ( ConstSpan< CellID > indices,
std::uint8_t * buffer ) const
virtual

Serialize data at locations indices to buffer

Implements olb::Communicatable.

Definition at line 330 of file column.hh.

332{
333 thrust::gather(thrust::device,
334 thrust::device_pointer_cast(indices.begin()),
335 thrust::device_pointer_cast(indices.end()),
336 thrust::device_pointer_cast(_column.deviceData()),
337 thrust::device_pointer_cast(reinterpret_cast<T*>(buffer)));
338 return indices.size() * sizeof(T);
339}

References olb::ConstSpan< T >::begin(), olb::ConstSpan< T >::end(), and olb::ConstSpan< T >::size().

+ Here is the call graph for this function:

◆ size()

template<typename T >
std::size_t olb::ConcreteCommunicatable< gpu::cuda::Column< T > >::size ( ConstSpan< CellID > indices) const
inlinevirtual

Get serialized size for data at locations indices

Implements olb::Communicatable.

Definition at line 208 of file column.h.

209 {
210 return indices.size() * sizeof(T);
211 }

References olb::ConstSpan< T >::size().

+ Here is the call graph for this function:

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