DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align > Class Template Reference

Device-callable view onto ArrayEigenMatrix rows. More...

#include <ArrayEigenMatrix_DeviceView.hpp>

Inheritance diagram for DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >:
[legend]
Collaboration diagram for DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >:
[legend]

Public Types

using t_base = ArrayDeviceView< B, real_T, __OneMatGetRowSize< _mat_ni, _mat_nj >(), __OneMatGetRowSize< _mat_ni_max, _mat_nj_max >(), _align >
 
using t_self = ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >
 
using t_EigenMatrix = Eigen::Matrix< std::remove_cv_t< real_T >, RowSize_To_EigenSize(_mat_ni), RowSize_To_EigenSize(_mat_nj)>
 
using t_EigenMap_const = Eigen::Map< const t_EigenMatrix, Eigen::Unaligned >
 
using t_EigenMap = std::conditional_t< std::is_const_v< real_T >, t_EigenMap_const, Eigen::Map< t_EigenMatrix, Eigen::Unaligned > >
 
using t_EigenView = EigenMatrixView< B, real_T, RowSize_To_EigenSize(_mat_ni), RowSize_To_EigenSize(_mat_nj)>
 
using t_EigenView_const = EigenMatrixView< B, const real_T, RowSize_To_EigenSize(_mat_ni), RowSize_To_EigenSize(_mat_nj)>
 
- Public Types inherited from DNDS::ArrayLayout< T, _row_size, _row_max, _align >
using value_type = T
 

Public Member Functions

DNDS_DEVICE_CALLABLE ArrayEigenMatrixDeviceView (const t_base &base_view, const rowsize *n_mat_nRows, rowsize n_mat_nRow_dynamic)
 
DNDS_DEVICE_CALLABLE rowsize MatRowSize (index iMat=0) const
 
DNDS_DEVICE_CALLABLE rowsize MatColSize (index iMat=0) const
 
DNDS_DEVICE_CALLABLE t_EigenMap operator[] (index iRow)
 
DNDS_DEVICE_CALLABLE t_EigenMap_const operator[] (index iRow) const
 
DNDS_DEVICE_CALLABLE std::conditional_t< _mat_ni==1 &&_mat_nj==1, real &, void > operator() (index iRow)
 
DNDS_DEVICE_CALLABLE std::conditional_t< _mat_ni==1 &&_mat_nj==1, real, void > operator() (index iRow) const
 
DNDS_DEVICE_CALLABLE std::conditional_t< _mat_ni==1||_mat_nj==1, real &, void > operator() (index iRow, rowsize j)
 
DNDS_DEVICE_CALLABLE std::conditional_t< _mat_ni==1||_mat_nj==1, real, void > operator() (index iRow, rowsize j) const
 
DNDS_DEVICE_CALLABLE t_EigenView MatView (index iRow)
 
DNDS_DEVICE_CALLABLE t_EigenView MatView (index iRow) const
 
- Public Member Functions inherited from DNDS::ArrayDeviceView< B, T, _row_size, _row_max, _align >
 ArrayDeviceView ()=delete
 
- Public Member Functions inherited from DNDS::ArrayView< T, _row_size, _row_max, _align >
DNDS_DEVICE_CALLABLE ArrayView (index n_size, T *n_data, index n_data_size, const index *n_rowstart, index n_rowstart_size, const rowsize *n_rowsizes, index n_rowsizes_size, rowsize n_row_size_dynamic, bool n_isCompressed, t_dataUncompressed *n_p_dataUncompressed)
 Construct a view from raw pointers. Intended for internal use by Array::view().
 
DNDS_DEVICE_CALLABLE bool isCompressed () const
 Whether the underlying array is in the compressed (flat) form (always true for non-CSR).
 
DNDS_DEVICE_CALLABLE index Size () const
 Number of rows in the viewed array.
 
DNDS_DEVICE_CALLABLE rowsize RowSize () const
 Uniform row width for fixed layouts (asserts otherwise).
 
DNDS_DEVICE_CALLABLE rowsize RowSize (index iRow) const
 Per-row width. Handles CSR compressed and decompressed modes.
 
DNDS_DEVICE_CALLABLE rowsize RowSizeMax () const
 Maximum row width (TABLE_*Max only).
 
DNDS_DEVICE_CALLABLE rowsize RowSizeField () const
 "Logical" row-field width used by derived Eigen arrays; see Array::RowSizeField.
 
DNDS_DEVICE_CALLABLE rowsize RowSizeField (index iRow) const
 Per-row "field" size for CSR (= actual row width).
 
const T & at (index iRow, rowsize iCol) const
 Bounds-checked element read (not device-callable because CSR decompressed uses std::vector::at which throws on the host).
 
T & operator() (index iRow, rowsize iCol=0)
 2D indexed access (writable). See at.
 
const T & operator() (index iRow, rowsize iCol=0) const
 2D indexed access (read-only).
 
T * operator[] (index iRow)
 Raw row pointer. iRow == Size() is allowed for past-the-end queries (useful for computing buffer end in sweeps).
 
const T * operator[] (index iRow) const
 Const row pointer; see the non-const overload.
 
DNDS_DEVICE_CALLABLE T * data ()
 Raw pointer to the start of the flat data buffer.
 
DNDS_DEVICE_CALLABLE size_t DataSize () const
 Size of the flat data buffer in T elements.
 
DNDS_DEVICE_CALLABLE bool operator== (const self_type &R) const
 Pointer equality (two views referring to the same buffer).
 

Protected Attributes

std::conditional_t< _mat_ni==DynamicSize, rowsize, EmptyNoDefault_mat_nRow_dynamic = 0
 
std::conditional_t< _mat_ni==NonUniformSize, const rowsize *, EmptyNoDefault_mat_nRows = nullptr
 
- Protected Attributes inherited from DNDS::ArrayView< T, _row_size, _row_max, _align >
index _size
 
T * _data = nullptr
 
index _data_size = 0
 
std::conditional_t< _dataLayout==CSR, const index *, std::conditional_t< _dataLayout==TABLE_Max||_dataLayout==TABLE_StaticMax, const rowsize *, EmptyNoDefault > > _rowstart_or_rowsize = nullptr
 
bool _isCompressed = true
 
std::conditional_t< _dataLayout==TABLE_Max||_dataLayout==TABLE_Fixed, rowsize, EmptyNoDefault_row_size_dynamic = 0
 
std::conditional_t< _dataLayout==CSR, t_dataUncompressed *, EmptyNoDefault_p_dataUncompressed = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from DNDS::ArrayLayout< T, _row_size, _row_max, _align >
static constexpr DataLayout _GetDataLayout ()
 Deduce the DataLayout tag from the template parameters.
 
static std::string GetArrayName ()
 Human-readable type identifier including element typeid, sizes, and alignment.
 
static std::string GetArraySignature ()
 Compiler-independent identifier used by serializers to tag an array.
 
static std::string GetArraySignatureRelaxed ()
 Signature with _row_size / _row_max replaced by DynamicSize.
 
static std::tuple< int, int, int, int > ParseArraySignatureTuple (const std::string &v)
 Parse a signature string into (sizeof_T, row_size, row_max, align).
 
static bool ArraySignatureIsCompatible (const std::string &v)
 Whether a stored signature can be read into this array type.
 
- Static Public Attributes inherited from DNDS::ArrayLayout< T, _row_size, _row_max, _align >
static const rowsize al = _align
 
static const rowsize rs = _row_size
 
static const rowsize rm = _row_max
 
static const size_t sizeof_T = sizeof(value_type)
 
static const rowsize s_T = al == NoAlign ? sizeof_T : (sizeof_T / al + 1) * al
 
static const DataLayout _dataLayout = _GetDataLayout()
 
static const bool isCSR = _dataLayout == CSR
 
- Protected Types inherited from DNDS::ArrayView< T, _row_size, _row_max, _align >
using self_type = ArrayView< T, _row_size, _row_max, _align >
 
using t_Layout = ArrayLayout< T, _row_size, _row_max, _align >
 
using t_dataUncompressed = std::vector< std::vector< T > >
 
- Protected Member Functions inherited from DNDS::ArrayView< T, _row_size, _row_max, _align >
DNDS_DEVICE_CALLABLE rowsize RowSize_Compressed (index iRow) const
 
DNDS_DEVICE_CALLABLE const T & at_compressed (index iRow, rowsize iCol) const
 
DNDS_DEVICE_CALLABLE T * get_rowstart_pointer_compressed (index iRow)
 

Detailed Description

template<DeviceBackend B, class real_T, rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
class DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >

Device-callable view onto ArrayEigenMatrix rows.

Mirrors the host operator[] -> Eigen::Map<Matrix> but works inside CUDA kernels. The underlying ArrayDeviceView stores the flat row of Ni*Nj reals; this class reinterprets that row as an Eigen matrix.

Template Parameters
real_TDNDS::real or const DNDS::real.

Definition at line 47 of file ArrayEigenMatrix_DeviceView.hpp.

Member Typedef Documentation

◆ t_base

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
using DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::t_base = ArrayDeviceView<B, real_T, __OneMatGetRowSize<_mat_ni, _mat_nj>(), __OneMatGetRowSize<_mat_ni_max, _mat_nj_max>(), _align>

Definition at line 53 of file ArrayEigenMatrix_DeviceView.hpp.

◆ t_EigenMap

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
using DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::t_EigenMap = std::conditional_t<std::is_const_v<real_T>, t_EigenMap_const, Eigen::Map<t_EigenMatrix, Eigen::Unaligned> >

Definition at line 79 of file ArrayEigenMatrix_DeviceView.hpp.

◆ t_EigenMap_const

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
using DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::t_EigenMap_const = Eigen::Map<const t_EigenMatrix, Eigen::Unaligned>

Definition at line 78 of file ArrayEigenMatrix_DeviceView.hpp.

◆ t_EigenMatrix

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
using DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::t_EigenMatrix = Eigen::Matrix<std::remove_cv_t<real_T>, RowSize_To_EigenSize(_mat_ni), RowSize_To_EigenSize(_mat_nj)>

Definition at line 77 of file ArrayEigenMatrix_DeviceView.hpp.

◆ t_EigenView

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
using DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::t_EigenView = EigenMatrixView<B, real_T, RowSize_To_EigenSize(_mat_ni), RowSize_To_EigenSize(_mat_nj)>

Definition at line 82 of file ArrayEigenMatrix_DeviceView.hpp.

◆ t_EigenView_const

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
using DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::t_EigenView_const = EigenMatrixView<B, const real_T, RowSize_To_EigenSize(_mat_ni), RowSize_To_EigenSize(_mat_nj)>

Definition at line 83 of file ArrayEigenMatrix_DeviceView.hpp.

◆ t_self

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
using DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::t_self = ArrayEigenMatrixDeviceView<B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align>

Definition at line 58 of file ArrayEigenMatrix_DeviceView.hpp.

Constructor & Destructor Documentation

◆ ArrayEigenMatrixDeviceView()

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::ArrayEigenMatrixDeviceView ( const t_base base_view,
const rowsize n_mat_nRows,
rowsize  n_mat_nRow_dynamic 
)
inline

Definition at line 67 of file ArrayEigenMatrix_DeviceView.hpp.

Member Function Documentation

◆ MatColSize()

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE rowsize DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::MatColSize ( index  iMat = 0) const
inline

Definition at line 99 of file ArrayEigenMatrix_DeviceView.hpp.

Here is the call graph for this function:

◆ MatRowSize()

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE rowsize DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::MatRowSize ( index  iMat = 0) const
inline

Definition at line 85 of file ArrayEigenMatrix_DeviceView.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MatView() [1/2]

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE t_EigenView DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::MatView ( index  iRow)
inline

Definition at line 164 of file ArrayEigenMatrix_DeviceView.hpp.

Here is the call graph for this function:

◆ MatView() [2/2]

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE t_EigenView DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::MatView ( index  iRow) const
inline

Definition at line 170 of file ArrayEigenMatrix_DeviceView.hpp.

Here is the call graph for this function:

◆ operator()() [1/4]

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE std::conditional_t< _mat_ni==1 &&_mat_nj==1, real &, void > DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::operator() ( index  iRow)
inline

Definition at line 134 of file ArrayEigenMatrix_DeviceView.hpp.

◆ operator()() [2/4]

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE std::conditional_t< _mat_ni==1 &&_mat_nj==1, real, void > DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::operator() ( index  iRow) const
inline

Definition at line 142 of file ArrayEigenMatrix_DeviceView.hpp.

◆ operator()() [3/4]

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE std::conditional_t< _mat_ni==1||_mat_nj==1, real &, void > DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::operator() ( index  iRow,
rowsize  j 
)
inline

Definition at line 150 of file ArrayEigenMatrix_DeviceView.hpp.

◆ operator()() [4/4]

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE std::conditional_t< _mat_ni==1||_mat_nj==1, real, void > DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::operator() ( index  iRow,
rowsize  j 
) const
inline

Definition at line 158 of file ArrayEigenMatrix_DeviceView.hpp.

◆ operator[]() [1/2]

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE t_EigenMap DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::operator[] ( index  iRow)
inline

Definition at line 120 of file ArrayEigenMatrix_DeviceView.hpp.

Here is the call graph for this function:

◆ operator[]() [2/2]

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
DNDS_DEVICE_CALLABLE t_EigenMap_const DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::operator[] ( index  iRow) const
inline

Definition at line 126 of file ArrayEigenMatrix_DeviceView.hpp.

Here is the call graph for this function:

Member Data Documentation

◆ _mat_nRow_dynamic

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
std::conditional_t<_mat_ni == DynamicSize, rowsize, EmptyNoDefault> DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::_mat_nRow_dynamic = 0
protected

Definition at line 61 of file ArrayEigenMatrix_DeviceView.hpp.

◆ _mat_nRows

template<DeviceBackend B, class real_T , rowsize _mat_ni = 1, rowsize _mat_nj = 1, rowsize _mat_ni_max = _mat_ni, rowsize _mat_nj_max = _mat_nj, rowsize _align = NoAlign>
std::conditional_t<_mat_ni == NonUniformSize, const rowsize *, EmptyNoDefault> DNDS::ArrayEigenMatrixDeviceView< B, real_T, _mat_ni, _mat_nj, _mat_ni_max, _mat_nj_max, _align >::_mat_nRows = nullptr
protected

Definition at line 62 of file ArrayEigenMatrix_DeviceView.hpp.


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