28 template <vector_mode_t V>
35 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_ssqrt) || (is_double_precision_t<T> && impl::egblas::has_dsqrt)
36 || (is_complex_single_t<T> && impl::egblas::has_csqrt) || (is_complex_double_t<T> && impl::egblas::has_zsqrt);
49 template <
typename V = default_vec>
57 static constexpr T
apply(
const T& x) {
67 template <
typename V = default_vec>
79 template <
typename X,
typename Y>
86 impl::egblas::sqrt(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
96 template <
typename X,
typename Y>
101 impl::egblas::sqrt(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
113 static std::string
desc() noexcept {
121 template <
typename TT>
125 static constexpr
bool linear =
true;
126 static constexpr
bool thread_safe =
true;
133 template <vector_mode_t V>
134 static constexpr
bool vectorizable =
false;
139 template <
typename E>
140 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_ssqrt) || (is_double_precision_t<T> && impl::egblas::has_dsqrt)
141 || (is_complex_single_t<T> && impl::egblas::has_csqrt) || (is_complex_double_t<T> && impl::egblas::has_zsqrt);
167 template <
typename X,
typename Y>
174 impl::egblas::sqrt(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
184 template <
typename X,
typename Y>
189 impl::egblas::sqrt(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
201 static std::string
desc() noexcept {
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: sqrt.hpp:97
static Y & gpu_compute(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sqrt.hpp:185
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: sqrt.hpp:113
auto sqrt(E &&value) -> detail::unary_helper< E, sqrt_unary_op >
Apply square root on each value of the given expression.
Definition: function_expression_builder.hpp:24
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 vec_type< V > load(const vec_type< V > &x) noexcept
Compute several applications of the operator at a time.
Definition: sqrt.hpp:68
EGBLAS wrappers for the sqrt operation.
Root namespace for the ETL library.
Definition: adapter.hpp:15
typename V::template vec_type< T > vec_type
Definition: sqrt.hpp:50
static constexpr int complexity()
Estimate the complexity of operator.
Definition: sqrt.hpp:42
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: sqrt.hpp:29
static constexpr T apply(const T &x)
Apply the unary operator on x.
Definition: sqrt.hpp:156
static constexpr bool thread_safe
Indicates if the operator is thread safe or not.
Definition: sqrt.hpp:21
static auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sqrt.hpp:80
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: sqrt.hpp:35
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 auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: sqrt.hpp:168
Unary operation taking the square root value.
Definition: sqrt.hpp:19
static constexpr bool linear
Indicates if the operator is linear.
Definition: sqrt.hpp:20
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
static constexpr T apply(const T &x)
Apply the unary operator on x.
Definition: sqrt.hpp:57
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 constexpr int complexity()
Estimate the complexity of operator.
Definition: sqrt.hpp:147
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: sqrt.hpp:201