Expression Templates Library (ETL)
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
etl::gemm_expr< A, B, Strassen > Struct Template Reference

A transposition expression. More...

#include <gemm_expr.hpp>

Inheritance diagram for etl::gemm_expr< A, B, Strassen >:
Inheritance graph
[legend]
Collaboration diagram for etl::gemm_expr< A, B, Strassen >:
Collaboration graph
[legend]

Public Types

using value_type = value_t< A >
 The type of value of the expression.
 
using this_type = gemm_expr< A, B, Strassen >
 The type of this expression.
 
using base_type = base_temporary_expr_bin< this_type, A, B >
 The base type.
 
using left_traits = decay_traits< A >
 The traits of the sub type.
 
- Public Types inherited from etl::base_temporary_expr_bin< gemm_expr< A, B, Strassen >, A, B >
using this_type = base_temporary_expr_bin< gemm_expr< A, B, Strassen >, A, B >
 This type.
 
using base_type = base_temporary_expr< gemm_expr< A, B, Strassen >, true >
 The base type.
 
- Public Types inherited from etl::base_temporary_expr< gemm_expr< A, B, Strassen >, true >
using derived_t = gemm_expr< A, B, Strassen >
 The derived type.
 
using value_type = typename decay_traits< gemm_expr< A, B, Strassen > >::value_type
 The value type.
 
using result_type = temporary_detail::expr_result_t< Fast, gemm_expr< A, B, Strassen > >
 The result type.
 
using memory_type = value_type *
 The memory type.
 
using const_memory_type = const value_type *
 The const memory type.
 
using vec_type = typename VV::template vec_type< value_type >
 The vectorization type for VV.
 
- Public Types inherited from etl::value_testable< D >
using derived_t = D
 The derived type.
 
- Public Types inherited from etl::dim_testable< D >
using derived_t = D
 The derived type.
 
- Public Types inherited from etl::iterable< D, DMA >
using derived_t = D
 The derived type.
 

Public Member Functions

 gemm_expr (A a, B b)
 Construct a new expression. More...
 
 gemm_expr (A a, B b, value_type alpha)
 Construct a new expression. More...
 
template<typename AA , typename BB , typename C >
void apply_raw (AA &&a, BB &&b, C &&c) const
 Compute C = trans(A) * trans(B) More...
 
template<etl_expr C>
void assign_to (C &&c) const
 Assign to a matrix of the same storage order. More...
 
template<etl_expr L>
void assign_add_to (L &&lhs) const
 Add to the given left-hand-side expression. More...
 
template<etl_expr L>
void assign_sub_to (L &&lhs) const
 Sub from the given left-hand-side expression. More...
 
template<etl_expr L>
void assign_mul_to (L &&lhs) const
 Multiply the given left-hand-side expression. More...
 
template<etl_expr L>
void assign_div_to (L &&lhs) const
 Divide the given left-hand-side expression. More...
 
template<etl_expr L>
void assign_mod_to (L &&lhs) const
 Modulo the given left-hand-side expression. More...
 
- Public Member Functions inherited from etl::base_temporary_expr_bin< gemm_expr< A, B, Strassen >, A, B >
 base_temporary_expr_bin (A a, B b)
 Construct a new expression. More...
 
 base_temporary_expr_bin (const base_temporary_expr_bin &e)
 Construct a new expression by copy. More...
 
 base_temporary_expr_bin (base_temporary_expr_bin &&e) noexcept
 Construct a new expression by move. More...
 
bool alias (const E &rhs) const
 Test if this expression aliases with the given expression. More...
 
std::add_lvalue_reference_t< A > a ()
 Returns the sub expression. More...
 
cpp::add_const_lvalue_t< A > a () const
 Returns the sub expression. More...
 
std::add_lvalue_reference_t< B > b ()
 Returns the sub expression. More...
 
cpp::add_const_lvalue_t< B > b () const
 Returns the sub expression. More...
 
void visit (detail::evaluator_visitor &visitor) const
 Apply the given visitor to this expression and its descendants. More...
 
- Public Member Functions inherited from etl::base_temporary_expr< gemm_expr< A, B, Strassen >, true >
 base_temporary_expr ()
 Construct a new base_temporary_expr.
 
 base_temporary_expr (const base_temporary_expr &expr)=default
 Copy construct a new base_temporary_expr.
 
 base_temporary_expr (base_temporary_expr &&rhs)
 Move construct a base_temporary_expr The right hand side cannot be used anymore after ths move. More...
 
base_temporary_exproperator= (const base_temporary_expr &)=delete
 
base_temporary_exproperator= (base_temporary_expr &&)=delete
 
value_type operator[] (size_t i) const
 Returns the element at the given index. More...
 
value_type read_flat (size_t i) const
 Returns the value at the given index This function never alters the state of the container. More...
 
- Public Member Functions inherited from etl::value_testable< 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_finite () const noexcept
 Indicates if the expression contains only finite values. More...
 
bool is_zero () const noexcept
 Indicates if the expression contains only zero values. More...
 
bool is_diagonal () const noexcept
 Indicates if the expression is diagonal. More...
 
bool is_uniform () const noexcept
 Indicates if the expression is uniform, i.e. all elements are of the same value. More...
 
- Public Member Functions inherited from etl::dim_testable< 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...
 
- Public Member Functions inherited from etl::iterable< D, DMA >
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...
 
auto begin () noexcept
 Return an iterator to the first element of the matrix. More...
 
auto end () noexcept
 Return an iterator to the past-the-end element of the matrix. More...
 
auto cbegin () const noexcept
 Return an iterator to the first element of the matrix. More...
 
auto cend () const noexcept
 Return an iterator to the past-the-end element of the matrix. More...
 
auto begin () const noexcept
 Return an iterator to the first element of the matrix. More...
 
auto end () const noexcept
 Return an iterator to the past-the-end element of the matrix. More...
 

Static Public Member Functions

template<etl_expr C>
static void check ([[maybe_unused]] const A &a, [[maybe_unused]] const B &b, [[maybe_unused]] const C &c)
 Assert for the validity of the matrix-matrix multiplication operation. More...
 
template<typename AA , typename BB , typename C >
static constexpr gemm_impl select_default_gemm_impl (bool no_gpu)
 Select an implementation of GEMM, not considering local context. More...
 
template<typename AA , typename BB , typename C >
static constexpr gemm_impl select_gemm_impl ()
 Select the best implementation of GEMM. More...
 

Public Attributes

const value_type alpha
 The alpha multiplicator.
 
- Public Attributes inherited from etl::base_temporary_expr_bin< gemm_expr< A, B, Strassen >, A, B >
_a
 The sub expression reference.
 
_b
 The sub expression reference.
 

Static Public Attributes

static constexpr auto storage_order = left_traits::storage_order
 The sub storage order.
 
static constexpr bool gpu_computable = cublas_enabled && all_homogeneous<A, B>
 Indicates if the temporary expression can be directly evaluated using only GPU.
 

Friends

std::ostream & operator<< (std::ostream &os, const gemm_expr &expr)
 Print a representation of the expression on the given stream. More...
 

Additional Inherited Members

- Protected Member Functions inherited from etl::base_temporary_expr< gemm_expr< A, B, Strassen >, true >
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_allocated () const noexcept
 Indicates if the temporary has been allocated. More...
 
bool is_evaluated () const noexcept
 Indicates if the temporary has been evaluated. More...
 
void evaluate () const
 Evaluate the expression, if not evaluated. More...
 
void allocate_temporary () const
 Allocate the necessary temporaries, if necessary.
 
result_typedyn_allocate (std::index_sequence< I... >) const
 Allocate the dynamic temporary.
 
result_typeallocate () const
 Allocate the temporary.
 
- Protected Attributes inherited from etl::base_temporary_expr< gemm_expr< A, B, Strassen >, true >
std::shared_ptr< bool > evaluated
 Indicates if the expression has been evaluated.
 
std::shared_ptr< result_type_c
 The result reference.
 

Detailed Description

template<etl_expr A, etl_expr B, bool Strassen>
struct etl::gemm_expr< A, B, Strassen >

A transposition expression.

Template Parameters
AThe transposed type

Constructor & Destructor Documentation

◆ gemm_expr() [1/2]

template<etl_expr A, etl_expr B, bool Strassen>
etl::gemm_expr< A, B, Strassen >::gemm_expr ( a,
b 
)
inlineexplicit

Construct a new expression.

Parameters
aThe sub expression

◆ gemm_expr() [2/2]

template<etl_expr A, etl_expr B, bool Strassen>
etl::gemm_expr< A, B, Strassen >::gemm_expr ( a,
b,
value_type  alpha 
)
inlineexplicit

Construct a new expression.

Parameters
aThe sub expression

Member Function Documentation

◆ apply_raw()

template<etl_expr A, etl_expr B, bool Strassen>
template<typename AA , typename BB , typename C >
void etl::gemm_expr< A, B, Strassen >::apply_raw ( AA &&  a,
BB &&  b,
C &&  c 
) const
inline

Compute C = trans(A) * trans(B)

Parameters
aThe A matrix
bThe B matrix
cThe C matrix (output)

◆ assign_add_to()

template<etl_expr A, etl_expr B, bool Strassen>
template<etl_expr L>
void etl::gemm_expr< A, B, Strassen >::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<etl_expr A, etl_expr B, bool Strassen>
template<etl_expr L>
void etl::gemm_expr< A, B, Strassen >::assign_div_to ( L &&  lhs) const
inline

Divide the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_mod_to()

template<etl_expr A, etl_expr B, bool Strassen>
template<etl_expr L>
void etl::gemm_expr< A, B, Strassen >::assign_mod_to ( L &&  lhs) const
inline

Modulo the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_mul_to()

template<etl_expr A, etl_expr B, bool Strassen>
template<etl_expr L>
void etl::gemm_expr< A, B, Strassen >::assign_mul_to ( L &&  lhs) const
inline

Multiply the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_sub_to()

template<etl_expr A, etl_expr B, bool Strassen>
template<etl_expr L>
void etl::gemm_expr< A, B, Strassen >::assign_sub_to ( L &&  lhs) const
inline

Sub from the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_to()

template<etl_expr A, etl_expr B, bool Strassen>
template<etl_expr C>
void etl::gemm_expr< A, B, Strassen >::assign_to ( C &&  c) const
inline

Assign to a matrix of the same storage order.

Parameters
cThe expression to which assign

◆ check()

template<etl_expr A, etl_expr B, bool Strassen>
template<etl_expr C>
static void etl::gemm_expr< A, B, Strassen >::check ( [[maybe_unused] ] const A &  a,
[[maybe_unused] ] const B &  b,
[[maybe_unused] ] const C &  c 
)
inlinestatic

Assert for the validity of the matrix-matrix multiplication operation.

Parameters
aThe left side matrix
bThe right side matrix
cThe result matrix

◆ select_default_gemm_impl()

template<etl_expr A, etl_expr B, bool Strassen>
template<typename AA , typename BB , typename C >
static constexpr gemm_impl etl::gemm_expr< A, B, Strassen >::select_default_gemm_impl ( bool  no_gpu)
inlinestatic

Select an implementation of GEMM, not considering local context.

Returns
The implementation to use

◆ select_gemm_impl()

template<etl_expr A, etl_expr B, bool Strassen>
template<typename AA , typename BB , typename C >
static constexpr gemm_impl etl::gemm_expr< A, B, Strassen >::select_gemm_impl ( )
inlinestatic

Select the best implementation of GEMM.

Returns
The implementation to use

Friends And Related Function Documentation

◆ operator<<

template<etl_expr A, etl_expr B, bool Strassen>
std::ostream& operator<< ( std::ostream &  os,
const gemm_expr< A, B, Strassen > &  expr 
)
friend

Print a representation of the expression on the given stream.

Parameters
osThe output stream
exprThe expression to print
Returns
the output stream

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