OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell > Class Template Referencefinal

Application of a cell-wise OPERATOR on a concrete CUDA block. More...

#include <operator.h>

+ Inheritance diagram for olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >:
+ Collaboration diagram for olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >:

Public Member Functions

 ConcreteBlockO ()
 
std::type_index id () const override
 
std::size_t weight () const override
 Get number of cells covered by operator (optional)
 
void set (CellID iCell, bool state) override
 Set whether iCell is covered by the operator (optional)
 
void setup (ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > &block) override
 
void apply (ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > &block) override
 
- Public Member Functions inherited from olb::BlockO< T, DESCRIPTOR, Platform::GPU_CUDA >
virtual void setup (ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &block)=0
 Setup operator context.
 
virtual void apply (ConcreteBlockLattice< T, DESCRIPTOR, PLATFORM > &block)=0
 Apply operator on block.
 
- Public Member Functions inherited from olb::AbstractBlockO
virtual ~AbstractBlockO ()=default
 

Detailed Description

template<typename T, typename DESCRIPTOR, concepts::CellOperator OPERATOR>
class olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >

Application of a cell-wise OPERATOR on a concrete CUDA block.

Definition at line 129 of file operator.h.

Constructor & Destructor Documentation

◆ ConcreteBlockO()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >::ConcreteBlockO ( )

Definition at line 644 of file operator.hh.

644 :
645 _cells(0),
646 _modified{false},
647 _stream{cudaStreamDefault}
648{ }

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >::apply ( ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > & block)
override

Definition at line 651 of file operator.hh.

653{
654 if (_cells.size() > 0) {
655 if (_modified) {
656 _cells.deduplicate();
658 _modified = false;
659 }
660 gpu::cuda::DeviceBlockLattice<T,DESCRIPTOR> lattice(block);
662 lattice,
663 _cells,
664 gpu::cuda::ListedPostProcessor<OPERATOR>{});
665 }
666}
void deduplicate()
Combined ascending sort and removal of duplicate entries.
Definition column.hh:109
void setProcessingContext(ProcessingContext)
Definition column.hh:158
std::size_t size() const override
Definition column.hh:128
void async_call_list_operators(cudaStream_t stream, CONTEXT &lattice, const gpu::cuda::Column< CellID > &cells, ARGS &&... args)
Apply operators to listed cell indices (async version)
Definition operator.hh:483
@ Simulation
Data available on host for e.g. functor evaluation.

References olb::gpu::cuda::async_call_list_operators(), and olb::Simulation.

+ Here is the call graph for this function:

◆ id()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
std::type_index olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >::id ( ) const
inlineoverridevirtual

Implements olb::AbstractBlockO.

Definition at line 140 of file operator.h.

141 {
142 return typeid(OPERATOR);
143 }
#define OPERATOR(OP, rhs)
Definition aDiffTape.h:64

References OPERATOR.

◆ set()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >::set ( CellID iCell,
bool state )
inlineoverridevirtual

Set whether iCell is covered by the operator (optional)

Implements olb::BlockO< T, DESCRIPTOR, Platform::GPU_CUDA >.

Definition at line 150 of file operator.h.

151 {
152 if (state) {
153 _cells.push_back(iCell);
154 _modified = true;
155 }
156 }
void push_back(T value)
Definition column.hh:102

References olb::gpu::cuda::Column< T >::push_back().

+ Here is the call graph for this function:

◆ setup()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
void olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >::setup ( ConcreteBlockLattice< T, DESCRIPTOR, Platform::GPU_CUDA > & block)
inlineoverride

Definition at line 158 of file operator.h.

159 {
160 _modified = false;
161 }

◆ weight()

template<typename T , typename DESCRIPTOR , concepts::CellOperator OPERATOR>
std::size_t olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >::weight ( ) const
inlineoverridevirtual

Get number of cells covered by operator (optional)

Implements olb::BlockO< T, DESCRIPTOR, Platform::GPU_CUDA >.

Definition at line 145 of file operator.h.

146 {
147 return _cells.size();
148 }

References olb::gpu::cuda::Column< T >::size().

+ Here is the call graph for this function:

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