|
Expression Templates Library (ETL)
|
A base class for adapters. More...
#include <adapter.hpp>

Public Types | |
| using | matrix_t = Matrix |
| The adapted matrix type. | |
| using | expr_t = matrix_t |
| The wrapped expression type. | |
| using | value_type = value_t< matrix_t > |
| The value type. | |
| using | memory_type = value_type * |
| The memory type. | |
| using | const_memory_type = const value_type * |
| The const memory type. | |
| template<typename V = default_vec> | |
| using | vec_type = typename V::template vec_type< value_type > |
| The vectorization type for V. | |
Public Member Functions | |
| adapter () noexcept | |
| Construct a new matrix and fill it with zeros. More... | |
| adapter (value_type value) noexcept | |
| Construct a new adapter matrix and fill it witht the given value. More... | |
| adapter (size_t dim) noexcept | |
| Construct a new adapter matrix and fill it with zeros. More... | |
| adapter (size_t dim, value_type value) noexcept | |
| Construct a new adapter matrix and fill it witht the given value. More... | |
| adapter (const adapter &rhs)=default | |
| Construct a adapter by copy. More... | |
| adapter & | operator= (const adapter &rhs)=default |
| Assign to the matrix by copy. More... | |
| adapter (adapter &&rhs) noexcept=default | |
| Construct a adapter by move. More... | |
| adapter & | operator= (adapter &&rhs) noexcept=default |
| Assign to the matrix by move. More... | |
| const value_type & | operator() (size_t i, size_t j) const noexcept |
| Access the (i, j) element of the 2D matrix. More... | |
| const value_type & | operator[] (size_t i) const noexcept |
| Returns the element at the given index. More... | |
| value_type & | operator[] (size_t i) noexcept |
| Returns the element at the given index. More... | |
| value_type | read_flat (size_t i) const noexcept |
| memory_type | memory_start () noexcept |
| Returns a pointer to the first element in memory. More... | |
| const_memory_type | memory_start () const noexcept |
| Returns a pointer to the first element in memory. More... | |
| memory_type | memory_end () noexcept |
| Returns a pointer to the past-the-end element in memory. More... | |
| const_memory_type | memory_end () const noexcept |
| Returns a pointer to the past-the-end element in memory. More... | |
| template<typename V = default_vec> | |
| vec_type< V > | load (size_t i) const noexcept |
| Load several elements of the matrix at once. More... | |
| template<typename V = default_vec> | |
| vec_type< V > | loadu (size_t i) const noexcept |
| Load several elements of the matrix at once. More... | |
| template<typename V = default_vec> | |
| void | stream (vec_type< V > in, size_t i) noexcept |
| Store several elements in the matrix at once, using non-temporal stores. More... | |
| template<typename V = default_vec> | |
| void | store (vec_type< V > in, size_t i) noexcept |
| Store several elements in the matrix at once. More... | |
| template<typename V = default_vec> | |
| void | storeu (vec_type< V > in, size_t i) noexcept |
| Store several elements in the matrix at once. More... | |
| template<typename E > | |
| bool | alias (const E &rhs) const noexcept |
| Test if this expression aliases with the given expression. More... | |
| 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 |
| Sub 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 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... | |
| value_type * | gpu_memory () const noexcept |
| Return GPU memory of this expression, if any. More... | |
| void | gpu_evict () const noexcept |
| Evict the expression from GPU. | |
| void | invalidate_cpu () const noexcept |
| Invalidates the CPU memory. | |
| void | invalidate_gpu () const noexcept |
| Invalidates the GPU memory. | |
| void | validate_cpu () const noexcept |
| Validates the CPU memory. | |
| void | validate_gpu () const noexcept |
| Validates the GPU memory. | |
| void | ensure_gpu_allocated () const |
| Ensures that the GPU memory is allocated and that the GPU memory is up to date (to undefined value). | |
| void | ensure_gpu_up_to_date () const |
| Allocate memory on the GPU for the expression and copy the values into the GPU. | |
| void | ensure_cpu_up_to_date () const |
| Copy back from the GPU to the expression memory if necessary. | |
| void | gpu_copy_from (const value_type *gpu_memory) const |
| Copy from GPU to GPU. More... | |
| bool | is_cpu_up_to_date () const noexcept |
| Indicates if the CPU memory is up to date. More... | |
| bool | is_gpu_up_to_date () const noexcept |
| Indicates if the GPU memory is up to date. More... | |
Static Public Member Functions | |
| static constexpr size_t | dimensions () noexcept |
| Returns the number of dimensions of the matrix. More... | |
Protected Attributes | |
| matrix_t | value |
| The adapted matrix. | |
A base class for adapters.
|
inlinenoexcept |
Construct a new matrix and fill it with zeros.
This constructor can only be used when the matrix is fast
|
inlineexplicitnoexcept |
Construct a new adapter matrix and fill it witht the given value.
| value | The value to fill the matrix with |
This constructor can only be used when the matrix is fast
|
inlineexplicitnoexcept |
Construct a new adapter matrix and fill it with zeros.
| dim | The dimension of the matrix |
|
inlinenoexcept |
Construct a new adapter matrix and fill it witht the given value.
| value | The value to fill the matrix with |
| dim | The dimension of the matrix |
|
default |
Construct a adapter by copy.
| rhs | The right-hand-side matrix |
|
defaultnoexcept |
Construct a adapter by move.
| rhs | The right-hand-side matrix |
|
inlinenoexcept |
Test if this expression aliases with the given expression.
| rhs | The other expression to test |
|
inline |
Add to the given left-hand-side expression.
| lhs | The expression to which assign |
|
inline |
Divide the given left-hand-side expression.
| lhs | The expression to which assign |
|
inline |
Modulo the given left-hand-side expression.
| lhs | The expression to which assign |
|
inline |
Multiply the given left-hand-side expression.
| lhs | The expression to which assign |
|
inline |
Sub from the given left-hand-side expression.
| lhs | The expression to which assign |
|
inline |
Assign to the given left-hand-side expression.
| lhs | The expression to which assign |
|
inlinestaticnoexcept |
Returns the number of dimensions of the matrix.
|
inline |
Return a GPU computed version of this expression.
|
inline |
Return a GPU computed version of this expression.
|
inline |
Copy from GPU to GPU.
| gpu_memory | Pointer to CPU memory |
|
inlinenoexcept |
Return GPU memory of this expression, if any.
|
inlinenoexcept |
Indicates if the CPU memory is up to date.
|
inlinenoexcept |
Indicates if the GPU memory is up to date.
|
inlinenoexcept |
Load several elements of the matrix at once.
| i | The position at which to start. This will be aligned from the beginning (multiple of the vector size). |
| V | The vectorization mode to use |
|
inlinenoexcept |
Load several elements of the matrix at once.
| i | The position at which to start. This will be aligned from the beginning (multiple of the vector size). |
| V | The vectorization mode to use |
|
inlinenoexcept |
Returns a pointer to the past-the-end element in memory.
This should only be used by ETL itself in order not to void the adapter guarantee.
|
inlinenoexcept |
Returns a pointer to the past-the-end element in memory.
This should only be used by ETL itself in order not to void the adapter guarantee.
|
inlinenoexcept |
Returns a pointer to the first element in memory.
This should only be used by ETL itself in order not to void the adapter guarantee.
|
inlinenoexcept |
Returns a pointer to the first element in memory.
This should only be used by ETL itself in order not to void the adapter guarantee.
|
inlinenoexcept |
Access the (i, j) element of the 2D matrix.
| i | The index of the first dimension |
| j | The index of the second dimension |
Accessing an element outside the matrix results in Undefined Behaviour.
|
default |
Assign to the matrix by copy.
| rhs | The right-hand-side matrix |
|
defaultnoexcept |
Assign to the matrix by move.
| rhs | The right-hand-side matrix |
|
inlinenoexcept |
Returns the element at the given index.
| i | The index |
|
inlinenoexcept |
Returns the element at the given index.
| i | The index |
|
inlinenoexcept |
| i | The index |
|
inlinenoexcept |
Store several elements in the matrix at once.
| in | The several elements to store |
| i | The position at which to start. This will be aligned from the beginning (multiple of the vector size). |
| V | The vectorization mode to use |
|
inlinenoexcept |
Store several elements in the matrix at once.
| in | The several elements to store |
| i | The position at which to start. This will be aligned from the beginning (multiple of the vector size). |
| V | The vectorization mode to use |
|
inlinenoexcept |
Store several elements in the matrix at once, using non-temporal stores.
| in | The several elements to store |
| i | The position at which to start. This will be aligned from the beginning (multiple of the vector size). |
| V | The vectorization mode to use |
|
inline |
Apply the given visitor to this expression and its descendants.
| visitor | The visitor to apply |
1.8.13