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

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

#include <column.h>

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

Public Member Functions

 ConcreteCommunicatable (gpu::cuda::CyclicColumn< 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::CyclicColumn< T > >

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

Definition at line 225 of file column.h.

Constructor & Destructor Documentation

◆ ConcreteCommunicatable()

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

Definition at line 230 of file column.h.

230 :
231 _column{column} { }

Member Function Documentation

◆ deserialize()

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

Deserialize data at locations indices to buffer

Implements olb::Communicatable.

Definition at line 368 of file column.hh.

371{
372 thrust::scatter(thrust::device,
373 thrust::device_pointer_cast(reinterpret_cast<const T*>(buffer)),
374 thrust::device_pointer_cast(reinterpret_cast<const T*>(buffer) + indices.size()),
375 thrust::device_pointer_cast(indices.begin()),
376 thrust::device_pointer_cast(_column.deviceData()));
377 return indices.size() * sizeof(T);
378}

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::CyclicColumn< T > >::serialize ( ConstSpan< CellID > indices,
std::uint8_t * buffer ) const
virtual

Serialize data at locations indices to buffer

Implements olb::Communicatable.

Definition at line 355 of file column.hh.

358{
359 thrust::gather(thrust::device,
360 thrust::device_pointer_cast(indices.begin()),
361 thrust::device_pointer_cast(indices.end()),
362 thrust::device_pointer_cast(_column.deviceData()),
363 thrust::device_pointer_cast(reinterpret_cast<T*>(buffer)));
364 return indices.size() * sizeof(T);
365}

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::CyclicColumn< T > >::size ( ConstSpan< CellID > indices) const
inlinevirtual

Get serialized size for data at locations indices

Implements olb::Communicatable.

Definition at line 234 of file column.h.

235 {
236 return indices.size() * sizeof(T);
237 }

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

+ Here is the call graph for this function:

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