Expression Templates Library (ETL)
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
etl::one_if_max_sub_transformer< T > Struct Template Reference

Transformer to implement one if max sub on 2D matrix. More...

#include <flip_transformers.hpp>

Public Types

using sub_type = T
 The type on which the expression works.
 
using value_type = value_t< T >
 The type of valuie.
 

Public Member Functions

 one_if_max_sub_transformer (sub_type expr)
 Construct a new transformer around the given expression. More...
 
value_type operator[] (size_t i) const
 Returns the value at the given index. More...
 
value_type read_flat (size_t i) const
 Returns the value at the given index This function never has side effects. More...
 
value_type operator() (size_t i, size_t j) const
 Access to the value at the given (i, j) position. 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 (Y &y) const noexcept
 Compute the result of the operation using the GPU. More...
 
template<typename Y >
Y & gpu_compute (Y &y) const noexcept
 Compute the result of the operation using the GPU. More...
 
template<typename V >
void visit (V &&visitor) const
 Apply the given visitor to this expression and its descendants. More...
 
void ensure_cpu_up_to_date () 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
 Copy back from the GPU to the expression memory if necessary.
 

Public Attributes

friend etl_traits< one_if_max_sub_transformer >
 

Static Public Attributes

static constexpr bool gpu_computable = impl::egblas::has_sone_if_max_sub && all_row_major<T> && all_floating<T>
 

Friends

std::ostream & operator<< (std::ostream &os, const one_if_max_sub_transformer &transformer)
 Display the transformer on the given stream. More...
 

Detailed Description

template<etl_2d T>
struct etl::one_if_max_sub_transformer< T >

Transformer to implement one if max sub on 2D matrix.

Template Parameters
TThe type on which the transformer is applied

Constructor & Destructor Documentation

◆ one_if_max_sub_transformer()

template<etl_2d T>
etl::one_if_max_sub_transformer< T >::one_if_max_sub_transformer ( sub_type  expr)
inlineexplicit

Construct a new transformer around the given expression.

Parameters
exprThe sub expression

Member Function Documentation

◆ alias()

template<etl_2d T>
template<typename E >
bool etl::one_if_max_sub_transformer< T >::alias ( const E &  rhs) const
inlinenoexcept

Test if this expression aliases with the given expression.

Parameters
rhsThe other expression to test
Returns
true if the two expressions aliases, false otherwise

◆ gpu_compute()

template<etl_2d T>
template<typename Y >
Y& etl::one_if_max_sub_transformer< T >::gpu_compute ( Y &  y) const
inlinenoexcept

Compute the result of the operation using the GPU.

Parameters
xThe expression of the unary operation
yThe expression into which to store the reuslt

◆ gpu_compute_hint()

template<etl_2d T>
template<typename Y >
auto etl::one_if_max_sub_transformer< T >::gpu_compute_hint ( Y &  y) const
inlinenoexcept

Compute the result of the operation using the GPU.

Parameters
xThe expression of the unary operation
Returns
The result of applying the unary operator on x. The result must be a GPU computed expression.

◆ operator()()

template<etl_2d T>
value_type etl::one_if_max_sub_transformer< T >::operator() ( size_t  i,
size_t  j 
) const
inline

Access to the value at the given (i, j) position.

Parameters
iThe first index
jThe second index
Returns
The value at the position (i, j)

◆ operator[]()

template<etl_2d T>
value_type etl::one_if_max_sub_transformer< T >::operator[] ( size_t  i) const
inline

Returns the value at the given index.

Parameters
iThe index
Returns
the value at the given index.

◆ read_flat()

template<etl_2d T>
value_type etl::one_if_max_sub_transformer< T >::read_flat ( size_t  i) const
inline

Returns the value at the given index This function never has side effects.

Parameters
iThe index
Returns
the value at the given index.

◆ visit()

template<etl_2d T>
template<typename V >
void etl::one_if_max_sub_transformer< T >::visit ( V &&  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<etl_2d T>
std::ostream& operator<< ( std::ostream &  os,
const one_if_max_sub_transformer< T > &  transformer 
)
friend

Display the transformer on the given stream.

Parameters
osThe output stream
transformerThe transformer to print
Returns
the output stream

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