Compute Library
 21.11
relu< T, S > Struct Template Reference

RELU activation object. More...

#include <NEActivationFunctionDetail.h>

Public Types

using ExactType = typename wrapper::traits::neon_vector< T, S >::type
 SIMD vector type. More...
 
using ExactTagType = typename wrapper::traits::neon_vector< T, S >::tag_type
 SIMD vector tag type. More...
 

Public Member Functions

 relu (ActivationLayerInfo act_info)
 Construct a RELU activation object. More...
 
void operator() (ExactType &vval)
 Run activation function. More...
 
void operator() (T &val)
 Run activation function. More...
 

Data Fields

const ExactType vzero
 Vector of zeroes. More...
 

Detailed Description

template<typename T, int S>
struct arm_compute::detail::relu< T, S >

RELU activation object.

Definition at line 189 of file NEActivationFunctionDetail.h.

Member Typedef Documentation

◆ ExactTagType

using ExactTagType = typename wrapper::traits::neon_vector<T, S>::tag_type

SIMD vector tag type.

Definition at line 194 of file NEActivationFunctionDetail.h.

◆ ExactType

using ExactType = typename wrapper::traits::neon_vector<T, S>::type

SIMD vector type.

Definition at line 192 of file NEActivationFunctionDetail.h.

Constructor & Destructor Documentation

◆ relu()

relu ( ActivationLayerInfo  act_info)
inlineexplicit

Construct a RELU activation object.

Parameters
[in]act_infoActivation layer information.

Definition at line 200 of file NEActivationFunctionDetail.h.

References ARM_COMPUTE_UNUSED.

201  : vzero(wrapper::vdup_n(static_cast<T>(0), ExactTagType{}))
202  {
203  ARM_COMPUTE_UNUSED(act_info);
204  }
typename wrapper::traits::neon_vector< T, S >::tag_type ExactTagType
SIMD vector tag type.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
Definition: Error.h:152
const ExactType vzero
Vector of zeroes.
uint8x8_t vdup_n(uint8_t value, traits::vector_64_tag)
Definition: dup_n.h:41

Member Function Documentation

◆ operator()() [1/2]

void operator() ( ExactType vval)
inline

Run activation function.

Parameters
[in]vvalVector of values.

Definition at line 210 of file NEActivationFunctionDetail.h.

References arm_compute::wrapper::vmax().

211  {
212  vval = wrapper::vmax(vzero, vval);
213  }
const ExactType vzero
Vector of zeroes.
uint8x8_t vmax(const uint8x8_t &a, const uint8x8_t &b)
Definition: max.h:39

◆ operator()() [2/2]

void operator() ( T &  val)
inline

Run activation function.

Parameters
[in]valScalar value.

Definition at line 219 of file NEActivationFunctionDetail.h.

220  {
221  val = std::max(static_cast<T>(0), val);
222  }

Field Documentation

◆ vzero

const ExactType vzero

Vector of zeroes.

Definition at line 225 of file NEActivationFunctionDetail.h.


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