23 template <
typename V = default_vec>
34 template <vector_mode_t V>
41 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_ssin) || (is_double_precision_t<T> && impl::egblas::has_dsin)
42 || (is_complex_single_t<T> && impl::egblas::has_csin) || (is_complex_double_t<T> && impl::egblas::has_zsin);
57 static constexpr T
apply(
const T& x) noexcept {
67 template <
typename V = default_vec>
79 template <
typename X,
typename Y>
86 impl::egblas::sin(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
97 template <
typename X,
typename Y>
102 impl::egblas::sin(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
114 static std::string
desc() noexcept {
122 template <
typename TT>
126 static constexpr
bool linear =
true;
127 static constexpr
bool thread_safe =
true;
134 template <vector_mode_t V>
135 static constexpr
bool vectorizable =
false;
140 template <
typename E>
141 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_ssin) || (is_double_precision_t<T> && impl::egblas::has_dsin)
142 || (is_complex_single_t<T> && impl::egblas::has_csin) || (is_complex_double_t<T> && impl::egblas::has_zsin);
157 static constexpr
T apply(
const T& x) noexcept {
168 template <
typename X,
typename Y>
175 impl::egblas::sin(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
186 template <
typename X,
typename Y>
191 impl::egblas::sin(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
203 static std::string
desc() noexcept {
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: sin.hpp:41
auto sin(E &&value) -> detail::unary_helper< E, sin_unary_op >
Apply sinus on each value of the given expression.
Definition: function_expression_builder.hpp:114
static constexpr T apply(const T &x) noexcept
Apply the unary operator on x.
Definition: sin.hpp:57
static constexpr T apply(const T &x) noexcept
Apply the unary operator on x.
Definition: sin.hpp:157
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: sin.hpp:98
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 constexpr bool thread_safe
Indicates if the operator is thread safe or not.
Definition: sin.hpp:27
static Y & gpu_compute(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sin.hpp:187
SSE3 is the max vectorization available.
typename V::template vec_type< T > vec_type
Definition: sin.hpp:24
static vec_type< V > load(const vec_type< V > &x) noexcept
Compute several applications of the operator at a time.
Definition: sin.hpp:68
static auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sin.hpp:80
Root namespace for the ETL library.
Definition: adapter.hpp:15
static constexpr bool linear
Indicates if the operator is linear.
Definition: sin.hpp:26
EGBLAS wrappers for the sin operation.
static constexpr int complexity()
Estimate the complexity of operator.
Definition: sin.hpp:148
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: sin.hpp:203
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: sin.hpp:35
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: sin.hpp:114
Unary operation computing the sinus.
Definition: sin.hpp:19
decltype(auto) force_temporary_gpu_dim_only(E &&expr)
Force a temporary out of the expression, without copying its content.
Definition: temporary.hpp:223
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
static constexpr int complexity()
Estimate the complexity of operator.
Definition: sin.hpp:48
static auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sin.hpp:169
AVX is the max vectorization available.
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