OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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
 
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, CONCEPT(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 122 of file operator.h.

Constructor & Destructor Documentation

◆ ConcreteBlockO()

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

Definition at line 573 of file operator.hh.

573 :
574 _cells(0),
575 _modified{false},
576 _stream{cudaStreamDefault}
577{ }

Member Function Documentation

◆ apply()

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

Definition at line 580 of file operator.hh.

582{
583 if (_cells.size() > 0) {
584 if (_modified) {
585 _cells.deduplicate();
587 _modified = false;
588 }
589 gpu::cuda::DeviceBlockLattice<T,DESCRIPTOR> lattice(block);
591 lattice,
592 _cells,
593 gpu::cuda::ListedPostProcessor<OPERATOR>{});
594 }
595}
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
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:423
@ 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 , CONCEPT(CellOperator) OPERATOR>
std::type_index olb::ConcreteBlockO< T, DESCRIPTOR, Platform::GPU_CUDA, OPERATOR, OperatorScope::PerCell >::id ( ) const
inlineoverridevirtual

Implements olb::AbstractBlockO.

Definition at line 133 of file operator.h.

134 {
135 return typeid(OPERATOR);
136 }

◆ set()

template<typename T , typename DESCRIPTOR , CONCEPT(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 138 of file operator.h.

139 {
140 if (state) {
141 _cells.push_back(iCell);
142 _modified = true;
143 }
144 }
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 , CONCEPT(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 146 of file operator.h.

147 {
148 _modified = false;
149 }

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