25 template <vector_mode_t V>
45 template <
typename V = default_vec>
63 template <
typename V = default_vec>
65 return V::max(x, V::set(T(0)));
75 template <
typename X,
typename Y>
89 template <
typename X,
typename Y>
102 static std::string
desc() noexcept {
static Y & gpu_compute(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: relu.hpp:90
static constexpr bool thread_safe
Indicates if the operator is thread safe or not.
Definition: relu.hpp:18
auto max(L &&lhs, R &&rhs)
Create an expression with the max value of lhs or rhs.
Definition: expression_builder.hpp:65
Unary operation computing the RELU operation.
Definition: relu.hpp:16
typename V::template vec_type< T > vec_type
Definition: relu.hpp:46
auto relu(const E &value) -> detail::unary_helper< E, relu_unary_op >
Return the relu activation of the given ETL expression.
Definition: function_expression_builder.hpp:207
decltype(auto) select_smart_gpu_compute(X &x, Y &y)
Compute the expression into a representation that is GPU up to date and possibly store this represent...
Definition: helpers.hpp:434
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: relu.hpp:102
static auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: relu.hpp:76
Root namespace for the ETL library.
Definition: adapter.hpp:15
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: relu.hpp:26
constexpr bool cudnn_enabled
Indicates if the NVIDIA CUDNN library is available for ETL.
Definition: config.hpp:114
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: relu.hpp:32
static constexpr bool linear
Indicates if the operator is linear.
Definition: relu.hpp:17
decltype(auto) force_temporary_gpu_dim_only(E &&expr)
Force a temporary out of the expression, without copying its content.
Definition: temporary.hpp:223
static constexpr int complexity()
Estimate the complexity of operator.
Definition: relu.hpp:38
static T apply(const T &x)
Apply the unary operator on x.
Definition: relu.hpp:53
static vec_type< V > load(const vec_type< V > &x) noexcept
Compute several applications of the operator at a time.
Definition: relu.hpp:64
decltype(auto) smart_gpu_compute_hint(E &expr, Y &y)
Compute the expression into a representation that is GPU up to date.
Definition: helpers.hpp:368