Expression Templates Library (ETL)
Public Types | Public Member Functions | Static Public Attributes | Friends | List of all members
etl::gpu_dyn_matrix_impl< T, SO, D > Struct Template Referencefinal

GPU special Matrix with run-time fixed dimensions. More...

#include <gpu_dyn.hpp>

Inheritance diagram for etl::gpu_dyn_matrix_impl< T, SO, D >:
Inheritance graph
[legend]
Collaboration diagram for etl::gpu_dyn_matrix_impl< T, SO, D >:
Collaboration graph
[legend]

Public Types

using this_type = gpu_dyn_matrix_impl< T, SO, D >
 The type of this expression.
 
using base_type = dense_dyn_base< this_type, T, SO, D >
 The base type.
 
using iterable_base_type = iterable< this_type, SO==order::RowMajor >
 The iterable base type.
 
using value_type = T
 The value type.
 
using dimension_storage_impl = std::array< size_t, n_dimensions >
 The type used to store the dimensions.
 
using memory_type = value_type *
 The memory type.
 
using const_memory_type = const value_type *
 The const memory type.
 
using iterator = std::conditional_t< SO==order::RowMajor, value_type *, etl::iterator< this_type > >
 The iterator type.
 
using const_iterator = std::conditional_t< SO==order::RowMajor, const value_type *, etl::iterator< const this_type > >
 The const iterator type.
 
template<typename V = default_vec>
using vec_type = typename V::template vec_type< T >
 The vectorization type for V.
 
- Public Types inherited from etl::dense_dyn_base< gpu_dyn_matrix_impl< T, SO, D >, T, SO, D >
using value_type = T
 The type of the contained values.
 
using base_type = dyn_base< gpu_dyn_matrix_impl< T, SO, D >, T, D >
 The base type.
 
using this_type = dense_dyn_base< gpu_dyn_matrix_impl< T, SO, D >, T, SO, D >
 The type of this class.
 
using derived_t = gpu_dyn_matrix_impl< T, SO, D >
 The derived type.
 
using memory_type = value_type *
 The memory type.
 
using const_memory_type = const value_type *
 The const memory type.
 
using iterator = memory_type
 The type of iterator.
 
using const_iterator = const_memory_type
 The type of const iterator.
 
using dimension_storage_impl = typename base_type::dimension_storage_impl
 The storage type used to store the dimensions.
 
- Public Types inherited from etl::dim_testable< gpu_dyn_matrix_impl< T, SO, D > >
using derived_t = gpu_dyn_matrix_impl< T, SO, D >
 The derived type.
 

Public Member Functions

 gpu_dyn_matrix_impl () noexcept
 Construct an empty matrix. More...
 
 gpu_dyn_matrix_impl (const gpu_dyn_matrix_impl &rhs) noexcept(assert_nothrow)
 Copy construct a matrix. More...
 
 gpu_dyn_matrix_impl (gpu_dyn_matrix_impl &&rhs) noexcept
 Move construct a matrix. More...
 
gpu_dyn_matrix_imploperator= (const gpu_dyn_matrix_impl &rhs) noexcept(assert_nothrow)
 Copy assign from another matrix. More...
 
gpu_dyn_matrix_imploperator= (gpu_dyn_matrix_impl &&rhs) noexcept
 Move assign from another matrix. More...
 
template<etl_expr E>
gpu_dyn_matrix_imploperator= (E &&e) noexcept requires(!std
 Assign from an ETL expression. More...
 
gpu_dyn_matrix_imploperator= ([[maybe_unused]] value_type v) noexcept
 Assign a value to all elements of the matrix. More...
 
 ~gpu_dyn_matrix_impl () noexcept
 Destruct the matrix and release all its memory.
 
template<typename Y >
auto & gpu_compute_hint ([[maybe_unused]] Y &y)
 Return a GPU computed version of this expression. More...
 
template<typename Y >
const auto & gpu_compute_hint ([[maybe_unused]] Y &y) const
 Return a GPU computed version of this expression. More...
 
template<typename L >
void assign_to (L &&lhs) const
 Assign to the given left-hand-side expression. More...
 
template<typename L >
void assign_add_to (L &&lhs) const
 Add to the given left-hand-side expression. More...
 
template<typename L >
void assign_sub_to (L &&lhs) const
 Subtract from the given left-hand-side expression. More...
 
template<typename L >
void assign_mul_to (L &&lhs) const
 Multiply the given left-hand-side expression. More...
 
template<typename L >
void assign_div_to (L &&lhs) const
 Divide to the given left-hand-side expression. More...
 
template<typename L >
void assign_mod_to (L &&lhs) const
 Modulo the given left-hand-side expression. More...
 
void visit ([[maybe_unused]] const detail::evaluator_visitor &visitor) const
 Apply the given visitor to this expression and its descendants. More...
 
template<typename E >
void inherit ([[maybe_unused]] const E &e)
 Inherit the dimensions of an ETL expressions. This must only be called when the matrix has no dimensions. More...
 
void resize_scalar ()
 Resize the matrix as a scalar value. More...
 
- Public Member Functions inherited from etl::dense_dyn_base< gpu_dyn_matrix_impl< T, SO, D >, T, SO, D >
 dense_dyn_base () noexcept
 Initialize the dense_dyn_base with a size of 0.
 
 dense_dyn_base (const dense_dyn_base &rhs) noexcept
 Copy construct a dense_dyn_base. More...
 
 dense_dyn_base (const derived_t &rhs) noexcept
 Copy construct a derived_t. More...
 
 dense_dyn_base (dense_dyn_base &&rhs) noexcept
 Move construct a dense_dyn_base. More...
 
 dense_dyn_base (derived_t &&rhs) noexcept
 Move construct a derived_t. More...
 
 dense_dyn_base (size_t size, dimension_storage_impl dimensions) noexcept
 Construct a dense_dyn_base if the given size and dimensions. More...
 
 dense_dyn_base (E &&rhs) requires(!std
 Move construct a dense_dyn_base. More...
 
decltype(auto) operator() (size_t i) noexcept(assert_nothrow)
 Access the ith element of the container. More...
 
decltype(auto) operator() (size_t i) const noexcept(assert_nothrow)
 Access the ith element of the container. More...
 
- Public Member Functions inherited from etl::dim_testable< gpu_dyn_matrix_impl< T, SO, D > >
derived_tas_derived () noexcept
 Returns a reference to the derived object, i.e. the object using the CRTP injector. More...
 
const derived_tas_derived () const noexcept
 Returns a reference to the derived object, i.e. the object using the CRTP injector. More...
 
bool is_square () const noexcept
 Indicates if the expressions is of square dimensions (only for 2d expression) More...
 
bool is_rectangular () const noexcept
 Indicates if the expressions is of rectangular dimensions (only for 2d expression) More...
 
bool is_sub_square () const noexcept
 Indicates if the expressions is of square dimensions, ignoring the first dimension (only for 3d expression) More...
 
bool is_sub_rectangular () const noexcept
 Indicates if the expressions is of rectangular dimensions, ignoring the first dimension (only for 3d expression) More...
 
bool is_symmetric () const noexcept
 Indicates if the given expression is a symmetric matrix or not. More...
 
bool is_lower_triangular () const noexcept
 Indicates if the given expression is a lower triangular matrix or not. More...
 
bool is_uni_lower_triangular () const noexcept
 Indicates if the given expression is a uni lower triangular matrix or not. More...
 
bool is_strictly_lower_triangular () const noexcept
 Indicates if the given expression is a strictly lower triangular matrix or not. More...
 
bool is_upper_triangular () const noexcept
 Indicates if the given expression is a upper triangular matrix or not. More...
 
bool is_uni_upper_triangular () const noexcept
 Indicates if the given expression is a uni upper triangular matrix or not. More...
 
bool is_strictly_upper_triangular () const noexcept
 Indicates if the given expression is a strictly upper triangular matrix or not. More...
 
bool is_triangular () const noexcept
 Indicates if the given expression is a triangular matrix or not. More...
 

Static Public Attributes

static constexpr size_t n_dimensions = D
 The number of dimensions.
 
static constexpr order storage_order = SO
 The storage order.
 
static constexpr size_t alignment = default_intrinsic_traits<T>::alignment
 The memory alignment.
 
- Static Public Attributes inherited from etl::dense_dyn_base< gpu_dyn_matrix_impl< T, SO, D >, T, SO, D >
static constexpr size_t n_dimensions
 The number of dimensions.
 
static constexpr order storage_order
 The storage order.
 

Friends

std::ostream & operator<< (std::ostream &os, const gpu_dyn_matrix_impl &mat)
 Print the description of the matrix to the given stream. More...
 

Additional Inherited Members

- Public Attributes inherited from etl::dense_dyn_base< gpu_dyn_matrix_impl< T, SO, D >, T, SO, D >
value_type *ETL_RESTRICT _memory
 Pointer to the allocated memory.
 
gpu_memory_handler< T > _gpu
 The GPU memory handler.
 

Detailed Description

template<typename T, order SO, size_t D>
struct etl::gpu_dyn_matrix_impl< T, SO, D >

GPU special Matrix with run-time fixed dimensions.

The matrix support an arbitrary number of dimensions.

Constructor & Destructor Documentation

◆ gpu_dyn_matrix_impl() [1/3]

template<typename T, order SO, size_t D>
etl::gpu_dyn_matrix_impl< T, SO, D >::gpu_dyn_matrix_impl ( )
inlinenoexcept

Construct an empty matrix.

This matrix don't have any memory nor dimensionsand most operations will likely fail on it

◆ gpu_dyn_matrix_impl() [2/3]

template<typename T, order SO, size_t D>
etl::gpu_dyn_matrix_impl< T, SO, D >::gpu_dyn_matrix_impl ( const gpu_dyn_matrix_impl< T, SO, D > &  rhs)
inlinenoexcept

Copy construct a matrix.

Parameters
rhsThe matrix to copy

◆ gpu_dyn_matrix_impl() [3/3]

template<typename T, order SO, size_t D>
etl::gpu_dyn_matrix_impl< T, SO, D >::gpu_dyn_matrix_impl ( gpu_dyn_matrix_impl< T, SO, D > &&  rhs)
inlinenoexcept

Move construct a matrix.

Parameters
rhsThe matrix to move

Member Function Documentation

◆ assign_add_to()

template<typename T, order SO, size_t D>
template<typename L >
void etl::gpu_dyn_matrix_impl< T, SO, D >::assign_add_to ( L &&  lhs) const
inline

Add to the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_div_to()

template<typename T, order SO, size_t D>
template<typename L >
void etl::gpu_dyn_matrix_impl< T, SO, D >::assign_div_to ( L &&  lhs) const
inline

Divide to the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_mod_to()

template<typename T, order SO, size_t D>
template<typename L >
void etl::gpu_dyn_matrix_impl< T, SO, D >::assign_mod_to ( L &&  lhs) const
inline

Modulo the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_mul_to()

template<typename T, order SO, size_t D>
template<typename L >
void etl::gpu_dyn_matrix_impl< T, SO, D >::assign_mul_to ( L &&  lhs) const
inline

Multiply the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_sub_to()

template<typename T, order SO, size_t D>
template<typename L >
void etl::gpu_dyn_matrix_impl< T, SO, D >::assign_sub_to ( L &&  lhs) const
inline

Subtract from the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_to()

template<typename T, order SO, size_t D>
template<typename L >
void etl::gpu_dyn_matrix_impl< T, SO, D >::assign_to ( L &&  lhs) const
inline

Assign to the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ gpu_compute_hint() [1/2]

template<typename T, order SO, size_t D>
template<typename Y >
auto& etl::gpu_dyn_matrix_impl< T, SO, D >::gpu_compute_hint ( [[maybe_unused] ] Y &  y)
inline

Return a GPU computed version of this expression.

Returns
a GPU-computed ETL expression for this expression

◆ gpu_compute_hint() [2/2]

template<typename T, order SO, size_t D>
template<typename Y >
const auto& etl::gpu_dyn_matrix_impl< T, SO, D >::gpu_compute_hint ( [[maybe_unused] ] Y &  y) const
inline

Return a GPU computed version of this expression.

Returns
a GPU-computed ETL expression for this expression

◆ inherit()

template<typename T, order SO, size_t D>
template<typename E >
void etl::gpu_dyn_matrix_impl< T, SO, D >::inherit ( [[maybe_unused] ] const E &  e)
inline

Inherit the dimensions of an ETL expressions. This must only be called when the matrix has no dimensions.

Parameters
eThe expression to get the dimensions from.

◆ operator=() [1/4]

template<typename T, order SO, size_t D>
gpu_dyn_matrix_impl& etl::gpu_dyn_matrix_impl< T, SO, D >::operator= ( const gpu_dyn_matrix_impl< T, SO, D > &  rhs)
inlinenoexcept

Copy assign from another matrix.

This operator can change the dimensions of the matrix

Parameters
rhsThe matrix to copy from
Returns
A reference to the matrix

◆ operator=() [2/4]

template<typename T, order SO, size_t D>
gpu_dyn_matrix_impl& etl::gpu_dyn_matrix_impl< T, SO, D >::operator= ( gpu_dyn_matrix_impl< T, SO, D > &&  rhs)
inlinenoexcept

Move assign from another matrix.

The other matrix won't be usable after the move operation

Parameters
rhsThe matrix to move from
Returns
A reference to the matrix

◆ operator=() [3/4]

template<typename T, order SO, size_t D>
template<etl_expr E>
gpu_dyn_matrix_impl& etl::gpu_dyn_matrix_impl< T, SO, D >::operator= ( E &&  e)
inlinenoexcept

Assign from an ETL expression.

Parameters
eThe expression containing the values to assign to the matrix
Returns
A reference to the matrix

◆ operator=() [4/4]

template<typename T, order SO, size_t D>
gpu_dyn_matrix_impl& etl::gpu_dyn_matrix_impl< T, SO, D >::operator= ( [[maybe_unused] ] value_type  v)
inlinenoexcept

Assign a value to all elements of the matrix.

Parameters
vThe vlaue to assign to all elements

◆ resize_scalar()

template<typename T, order SO, size_t D>
void etl::gpu_dyn_matrix_impl< T, SO, D >::resize_scalar ( )
inline

Resize the matrix as a scalar value.

This must only be called when the matrix has no dimensions

◆ visit()

template<typename T, order SO, size_t D>
void etl::gpu_dyn_matrix_impl< T, SO, D >::visit ( [[maybe_unused] ] const detail::evaluator_visitor visitor) const
inline

Apply the given visitor to this expression and its descendants.

Parameters
visitorThe visitor to apply

Friends And Related Function Documentation

◆ operator<<

template<typename T, order SO, size_t D>
std::ostream& operator<< ( std::ostream &  os,
const gpu_dyn_matrix_impl< T, SO, D > &  mat 
)
friend

Print the description of the matrix to the given stream.

Parameters
osThe output stream
matThe matrix to output the description to the stream
Returns
The given output stream

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