OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::gpu::cuda::MaskedCollision< T, DESCRIPTOR, DYNAMICS > Class Template Reference

Masked application of DYNAMICS::apply for use in kernel::call_operators. More...

#include <operator.hh>

+ Collaboration diagram for olb::gpu::cuda::MaskedCollision< T, DESCRIPTOR, DYNAMICS >:

Public Member Functions

 MaskedCollision (ParametersOfOperatorD< T, DESCRIPTOR, DYNAMICS > &parameters, bool *mask) any_platform
 Constructor (commonly called on the host side)
 
bool operator() (DeviceContext< T, DESCRIPTOR > &lattice, CellID iCell) __device__
 Chainable call operator for use in kernel::call_operators.
 
bool operator() (DeviceContext< T, DESCRIPTOR > &lattice, CellID iCell, CellStatistic< T > &statistic) __device__
 Chainable call operator with statistics storage.
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename DYNAMICS>
class olb::gpu::cuda::MaskedCollision< T, DESCRIPTOR, DYNAMICS >

Masked application of DYNAMICS::apply for use in kernel::call_operators.

Definition at line 45 of file operator.hh.

Constructor & Destructor Documentation

◆ MaskedCollision()

template<typename T , typename DESCRIPTOR , typename DYNAMICS >
olb::gpu::cuda::MaskedCollision< T, DESCRIPTOR, DYNAMICS >::MaskedCollision ( ParametersOfOperatorD< T, DESCRIPTOR, DYNAMICS > & parameters,
bool * mask )
inline

Constructor (commonly called on the host side)

See e.g. getFusedCollisionO

Definition at line 62 of file operator.hh.

62 :
63 _parameters{parameters},
64 _mask{mask}
65 { }

Member Function Documentation

◆ operator()() [1/2]

template<typename T , typename DESCRIPTOR , typename DYNAMICS >
bool olb::gpu::cuda::MaskedCollision< T, DESCRIPTOR, DYNAMICS >::operator() ( DeviceContext< T, DESCRIPTOR > & lattice,
CellID iCell )
inline

Chainable call operator for use in kernel::call_operators.

Returns true iff MaskedCollision applies to iCell, enabling easy chaining by a fold expression to yield a fused collision kernel.

Definition at line 72 of file operator.hh.

72 {
73 if (_mask[iCell]) {
74 apply(lattice, iCell);
75 return true;
76 }
77 return false;
78 }

◆ operator()() [2/2]

template<typename T , typename DESCRIPTOR , typename DYNAMICS >
bool olb::gpu::cuda::MaskedCollision< T, DESCRIPTOR, DYNAMICS >::operator() ( DeviceContext< T, DESCRIPTOR > & lattice,
CellID iCell,
CellStatistic< T > & statistic )
inline

Chainable call operator with statistics storage.

Definition at line 81 of file operator.hh.

81 {
82 if (_mask[iCell]) {
83 statistic = apply(lattice, iCell);
84 return true;
85 }
86 return false;
87 }

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