28 template <vector_mode_t V>
36 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_ssinh) || (is_double_precision_t<T> && impl::egblas::has_dsinh)
37 || (is_complex_single_t<T> && impl::egblas::has_csinh) || (is_complex_double_t<T> && impl::egblas::has_zsinh);
50 template <
typename V = default_vec>
58 static constexpr T
apply(
const T& x) noexcept {
68 template <
typename V = default_vec>
70 return V::div((V::sub(
V::exp(x),
V::exp(V::minus(x)))), V::set(T(2)));
80 template <
typename X,
typename Y>
87 impl::egblas::sinh(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
98 template <
typename X,
typename Y>
103 impl::egblas::sinh(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
115 static std::string
desc() noexcept {
124 template <
typename TT>
128 static constexpr
bool linear =
true;
129 static constexpr
bool thread_safe =
true;
136 template <vector_mode_t V>
137 static constexpr
bool vectorizable =
false;
142 template <
typename E>
143 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_ssinh) || (is_double_precision_t<T> && impl::egblas::has_dsinh)
144 || (is_complex_single_t<T> && impl::egblas::has_csinh) || (is_complex_double_t<T> && impl::egblas::has_zsinh);
159 static constexpr
T apply(
const T& x) noexcept {
170 template <
typename X,
typename Y>
177 impl::egblas::sinh(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
188 template <
typename X,
typename Y>
193 impl::egblas::sinh(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
205 static std::string
desc() noexcept {
auto sinh(E &&value) -> detail::unary_helper< E, sinh_unary_op >
Apply hyperbolic sinus on each value of the given expression.
Definition: function_expression_builder.hpp:144
Complex number implementation.
Definition: complex.hpp:31
static Y & gpu_compute(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sinh.hpp:99
typename V::template vec_type< T > vec_type
Definition: sinh.hpp:51
static constexpr bool thread_safe
Indicates if the operator is thread safe or not.
Definition: sinh.hpp:21
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: sinh.hpp:29
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: sinh.hpp:36
static constexpr int complexity()
Estimate the complexity of operator.
Definition: sinh.hpp:43
static constexpr bool linear
Indicates if the operator is linear.
Definition: sinh.hpp:20
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
SSE3 is the max vectorization available.
static constexpr T apply(const T &x) noexcept
Apply the unary operator on x.
Definition: sinh.hpp:58
constexpr bool intel_compiler
Indicates if the projectis compiled with intel compiler.
Definition: config.hpp:225
Root namespace for the ETL library.
Definition: adapter.hpp:15
static auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sinh.hpp:81
static constexpr T apply(const T &x) noexcept
Apply the unary operator on x.
Definition: sinh.hpp:159
static vec_type< V > load(const vec_type< V > &x) noexcept
Compute several applications of the operator at a time.
Definition: sinh.hpp:69
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: sinh.hpp:150
static auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sinh.hpp:171
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
auto exp(E &&value) -> detail::unary_helper< E, exp_unary_op >
Apply exponential on each value of the given expression.
Definition: function_expression_builder.hpp:154
EGBLAS wrappers for the sinh operation.
AVX is the max vectorization available.
static Y & gpu_compute(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sinh.hpp:189
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: sinh.hpp:115
Unary operation computing the hyperbolic sinus.
Definition: sinh.hpp:19
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
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: sinh.hpp:205