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

Unary operation applying a logistic noise. More...

#include <noise.hpp>

Public Member Functions

 state_logistic_noise_unary_op ()
 Construct a new operator.
 
 state_logistic_noise_unary_op (const std::shared_ptr< void *> states)
 Construct a new operator.
 
apply (const T &x) const
 Apply the unary operator on x. More...
 
template<typename X , typename Y >
auto gpu_compute_hint (const X &x, Y &y) const noexcept
 Compute the result of the operation using the GPU. More...
 
template<typename X , typename Y >
Y & gpu_compute (const X &x, Y &y) const noexcept
 Compute the result of the operation using the GPU. More...
 

Static Public Member Functions

static constexpr int complexity ()
 Estimate the complexity of operator. More...
 
static std::string desc () noexcept
 Returns a textual representation of the operator. More...
 

Public Attributes

random_engine rand_engine
 The random generator.
 
std::shared_ptr< void * > states
 The random generator extra states.
 

Static Public Attributes

static constexpr bool linear = true
 Indicates if the operator is linear.
 
static constexpr bool thread_safe = false
 Indicates if the operator is thread safe or not.
 
template<vector_mode_t V>
static constexpr bool vectorizable = false
 Indicates if the expression is vectorizable using the given vector mode. More...
 
template<typename E >
static constexpr bool gpu_computable
 Indicates if the operator can be computed on GPU. More...
 

Detailed Description

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

Unary operation applying a logistic noise.

This version is stateful in that the random generator states are created only once. This has an improvement on GPU.

Template Parameters
TThe type of value

Member Function Documentation

◆ apply()

template<typename T >
T etl::state_logistic_noise_unary_op< T >::apply ( const T &  x) const
inline

Apply the unary operator on x.

Parameters
xThe value on which to apply the operator
Returns
The result of applying the unary operator on x

◆ complexity()

template<typename T >
static constexpr int etl::state_logistic_noise_unary_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::state_logistic_noise_unary_op< T >::desc ( )
inlinestaticnoexcept

Returns a textual representation of the operator.

Returns
a string representing the operator

◆ gpu_compute()

template<typename T >
template<typename X , typename Y >
Y& etl::state_logistic_noise_unary_op< T >::gpu_compute ( const X &  x,
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<typename T >
template<typename X , typename Y >
auto etl::state_logistic_noise_unary_op< T >::gpu_compute_hint ( const X &  x,
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.

Member Data Documentation

◆ gpu_computable

template<typename T >
template<typename E >
constexpr bool etl::state_logistic_noise_unary_op< T >::gpu_computable
static
Initial value:
= (is_single_precision_t<T> && impl::egblas::has_slogistic_noise_seed)
|| (is_double_precision_t<T> && impl::egblas::has_dlogistic_noise_seed)

Indicates if the operator can be computed on GPU.

◆ vectorizable

template<typename T >
template<vector_mode_t V>
constexpr bool etl::state_logistic_noise_unary_op< T >::vectorizable = false
static

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

Template Parameters
VThe vector mode

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