19 template <
typename T,
typename S>
24 template <
typename V = default_vec>
35 template <vector_mode_t V>
42 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_sclip_value)
43 || (is_double_precision_t<T> && impl::egblas::has_dclip_value)
44 || (is_complex_single_t<T> && impl::egblas::has_cclip_value)
45 || (is_complex_double_t<T> && impl::egblas::has_zclip_value);
70 constexpr T
apply(
const T& x)
const noexcept {
74 #ifdef __INTEL_COMPILER 82 template <
typename V = default_vec>
96 template <
typename X,
typename Y>
101 impl::egblas::clip_value(
etl::size(y), T(1), min, max, t2.gpu_memory(), 1);
111 template <
typename X,
typename Y>
115 impl::egblas::clip_value(
etl::size(y), T(1), min, max, y.gpu_memory(), 1);
127 static std::string
desc() noexcept {
S min
The minimum for clipping.
Definition: clip.hpp:55
auto max(L &&lhs, R &&rhs)
Create an expression with the max value of lhs or rhs.
Definition: expression_builder.hpp:65
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: clip.hpp:36
Unary operation that clips all values between two scalars.
Definition: clip.hpp:20
Y & gpu_compute(const X &x, Y &y) const noexcept
Compute the result of the operation using the GPU.
Definition: clip.hpp:112
typename V::template vec_type< T > vec_type
Definition: clip.hpp:25
static constexpr int complexity()
Estimate the complexity of operator.
Definition: clip.hpp:51
constexpr bool intel_compiler
Indicates if the projectis compiled with intel compiler.
Definition: config.hpp:225
auto load(size_t x) const noexcept
Load several elements of the expression at once.
Definition: dyn_matrix_view.hpp:143
Root namespace for the ETL library.
Definition: adapter.hpp:15
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: clip.hpp:127
clip_scalar_op(S min, S max)
Builds a new operator.
Definition: clip.hpp:63
auto min(L &&lhs, R &&rhs)
Create an expression with the min value of lhs or rhs.
Definition: expression_builder.hpp:77
static constexpr bool linear
Indicates if the operator is linear or not.
Definition: clip.hpp:27
constexpr T apply(const T &x) const noexcept
Apply the unary operator on x.
Definition: clip.hpp:70
auto gpu_compute_hint(const X &x, Y &y) const noexcept
Compute the result of the operation using the GPU.
Definition: clip.hpp:97
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
EGBLAS wrappers for the clip_value operation.
static constexpr bool thread_safe
Indicates if the operator is thread safe or not.
Definition: clip.hpp:28
decltype(auto) force_temporary_gpu(E &&expr)
Force a temporary out of the expression.
Definition: temporary.hpp:196
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
decltype(auto) smart_gpu_compute(X &x, Y &y)
Compute the expression into a representation that is GPU up to date and store this representation in ...
Definition: helpers.hpp:397
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: clip.hpp:42
S max
The maximum for clipping.
Definition: clip.hpp:56