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

Binary operator for scalar division. More...

#include <div.hpp>

Public Types

template<typename V = default_vec>
using vec_type = typename V::template vec_type< T >
 

Static Public Member Functions

static constexpr int complexity ()
 Estimate the complexity of operator. More...
 
static constexpr T apply (const T &lhs, const T &rhs) noexcept
 Apply the unary operator on lhs and rhs. More...
 
template<typename V = default_vec>
static vec_type< V > load (const vec_type< V > &lhs, const vec_type< V > &rhs) noexcept
 Compute several applications of the operator at a time. More...
 
template<typename L , typename R , typename Y >
static auto gpu_compute_hint (const L &lhs, const R &rhs, Y &y) noexcept
 Compute the result of the operation using the GPU. More...
 
template<typename L , typename R , typename Y >
static Y & gpu_compute (const L &lhs, const R &rhs, Y &yy) noexcept
 Compute the result of the operation using the GPU. More...
 
static std::string desc () noexcept
 Returns a textual representation of the operator. More...
 

Static Public Attributes

static constexpr bool linear = true
 Indicates if the operator is linear or not.
 
static constexpr bool thread_safe = true
 Indicates if the operator is thread safe or not.
 
static constexpr bool desc_func = false
 Indicates if the description must be printed as function.
 
template<vector_mode_t V>
static constexpr bool vectorizable = is_floating_t<T> || (is_complex_t<T> && V != vector_mode_t::AVX512)
 Indicates if the expression is vectorizable using the given vector mode. More...
 
template<typename L , typename R >
static constexpr bool gpu_computable
 Indicates if the operator can be computd on GPU. More...
 

Detailed Description

template<typename T>
struct etl::div_binary_op< T >

Binary operator for scalar division.

Member Typedef Documentation

◆ vec_type

template<typename T >
template<typename V = default_vec>
using etl::div_binary_op< T >::vec_type = typename V::template vec_type<T>

The vectorization type for V

Member Function Documentation

◆ apply()

template<typename T >
static constexpr T etl::div_binary_op< T >::apply ( const T &  lhs,
const T &  rhs 
)
inlinestaticnoexcept

Apply the unary operator on lhs and rhs.

Parameters
lhsThe left hand side value on which to apply the operator
rhsThe right hand side value on which to apply the operator
Returns
The result of applying the binary operator on lhs and rhs

◆ complexity()

template<typename T >
static constexpr int etl::div_binary_op< T >::complexity ( )
inlinestatic

Estimate the complexity of operator.

Returns
An estimation of the complexity of the operator

◆ desc()

template<typename T >
static std::string etl::div_binary_op< T >::desc ( )
inlinestaticnoexcept

Returns a textual representation of the operator.

Returns
a string representing the operator

◆ gpu_compute()

template<typename T >
template<typename L , typename R , typename Y >
static Y& etl::div_binary_op< T >::gpu_compute ( const L &  lhs,
const R &  rhs,
Y &  yy 
)
inlinestaticnoexcept

Compute the result of the operation using the GPU.

Parameters
lhsThe left hand side value on which to apply the operator
rhsThe right hand side value on which to apply the operator
Returns
The result of applying the binary operator on lhs and rhs. The result must be a GPU computed expression.

◆ gpu_compute_hint()

template<typename T >
template<typename L , typename R , typename Y >
static auto etl::div_binary_op< T >::gpu_compute_hint ( const L &  lhs,
const R &  rhs,
Y &  y 
)
inlinestaticnoexcept

Compute the result of the operation using the GPU.

Parameters
lhsThe left hand side value on which to apply the operator
rhsThe right hand side value on which to apply the operator
Returns
The result of applying the binary operator on lhs and rhs. The result must be a GPU computed expression.

◆ load()

template<typename T >
template<typename V = default_vec>
static vec_type<V> etl::div_binary_op< T >::load ( const vec_type< V > &  lhs,
const vec_type< V > &  rhs 
)
inlinestaticnoexcept

Compute several applications of the operator at a time.

Parameters
lhsThe left hand side vector
rhsThe right hand side vector
Template Parameters
VThe vectorization mode
Returns
a vector containing several results of the operator

Member Data Documentation

◆ gpu_computable

template<typename T >
template<typename L , typename R >
constexpr bool etl::div_binary_op< T >::gpu_computable
static
Initial value:
=
((!is_scalar<L> && !is_scalar<R>)&&((is_single_precision_t<T> && impl::egblas::has_saxdy_3 && impl::egblas::has_saxdbpy_3
&& impl::egblas::has_sapxdbpy_3 && impl::egblas::has_sapxdby_3)
|| (is_double_precision_t<T> && impl::egblas::has_daxdy_3 && impl::egblas::has_daxdbpy_3
&& impl::egblas::has_dapxdbpy_3 && impl::egblas::has_dapxdby_3)
|| (is_complex_single_t<T> && impl::egblas::has_caxdy_3 && impl::egblas::has_caxdbpy_3
&& impl::egblas::has_capxdbpy_3 && impl::egblas::has_capxdby_3)
|| (is_complex_double_t<T> && impl::egblas::has_zaxdy_3 && impl::egblas::has_zaxdbpy_3
&& impl::egblas::has_zapxdbpy_3 && impl::egblas::has_zapxdby_3)))
|| ((is_scalar<L> != is_scalar<R>)&&((is_single_precision_t<T> && impl::egblas::has_scalar_smul && impl::egblas::has_scalar_sdiv)
|| (is_double_precision_t<T> && impl::egblas::has_scalar_dmul && impl::egblas::has_scalar_ddiv)
|| (is_complex_single_t<T> && impl::egblas::has_scalar_cmul && impl::egblas::has_scalar_cdiv)
|| (is_complex_double_t<T> && impl::egblas::has_scalar_zmul && impl::egblas::has_scalar_zdiv)))

Indicates if the operator can be computd on GPU.

◆ vectorizable

template<typename T >
template<vector_mode_t V>
constexpr bool etl::div_binary_op< T >::vectorizable = is_floating_t<T> || (is_complex_t<T> && V != vector_mode_t::AVX512)
static

Indicates if the expression is vectorizable using the given vector mode.

Template Parameters
VThe vector mode

Note: Integer division is not yet supported


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