28 template <vector_mode_t V>
35 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_scbrt) || (is_double_precision_t<T> && impl::egblas::has_dcbrt)
36 || (is_complex_single_t<T> && impl::egblas::has_ccbrt) || (is_complex_double_t<T> && impl::egblas::has_zcbrt);
51 static constexpr T
apply(
const T& x) {
62 template <
typename X,
typename Y>
69 impl::egblas::cbrt(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
79 template <
typename X,
typename Y>
84 impl::egblas::cbrt(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
96 static std::string
desc() noexcept {
104 template <
typename TT>
106 using T = std::complex<TT>;
108 static constexpr
bool linear =
true;
109 static constexpr
bool thread_safe =
true;
116 template <vector_mode_t V>
117 static constexpr
bool vectorizable =
false;
122 template <
typename E>
123 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_scbrt) || (is_double_precision_t<T> && impl::egblas::has_dcbrt)
124 || (is_complex_single_t<T> && impl::egblas::has_ccbrt) || (is_complex_double_t<T> && impl::egblas::has_zcbrt);
143 auto new_abs = std::cbrt(z_abs);
144 auto new_arg = z_arg / 3.0f;
156 template <
typename X,
typename Y>
163 impl::egblas::cbrt(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
173 template <
typename X,
typename Y>
178 impl::egblas::cbrt(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
190 static std::string
desc() noexcept {
198 template <
typename TT>
202 static constexpr
bool linear =
true;
203 static constexpr
bool thread_safe =
true;
210 template <vector_mode_t V>
211 static constexpr
bool vectorizable =
false;
216 template <
typename E>
217 static constexpr
bool gpu_computable = (is_single_precision_t<T> && impl::egblas::has_scbrt) || (is_double_precision_t<T> && impl::egblas::has_dcbrt)
218 || (is_complex_single_t<T> && impl::egblas::has_ccbrt) || (is_complex_double_t<T> && impl::egblas::has_zcbrt);
244 template <
typename X,
typename Y>
251 impl::egblas::cbrt(
etl::size(y), alpha, t1.gpu_memory(), 1, t2.gpu_memory(), 1);
261 template <
typename X,
typename Y>
266 impl::egblas::cbrt(
etl::size(y), alpha, t1.gpu_memory(), 1, y.gpu_memory(), 1);
278 static std::string
desc() noexcept {
static constexpr int complexity()
Estimate the complexity of operator.
Definition: cbrt.hpp:130
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 std::string desc() noexcept
Returns a textual representation of the operator.
Definition: cbrt.hpp:278
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: cbrt.hpp:80
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
auto cbrt(E &&value) -> detail::unary_helper< E, cbrt_unary_op >
Apply cubic root on each value of the given expression.
Definition: function_expression_builder.hpp:44
static Y & gpu_compute(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: cbrt.hpp:174
Unary operation taking the cubic root value.
Definition: cbrt.hpp:19
static constexpr T apply(const T &x)
Apply the unary operator on x.
Definition: cbrt.hpp:233
static constexpr T apply(const T &x)
Apply the unary operator on x.
Definition: cbrt.hpp:51
auto abs(E &&value)
Apply absolute on each value of the given expression.
Definition: expression_builder.hpp:54
static constexpr int complexity()
Estimate the complexity of operator.
Definition: cbrt.hpp:224
static auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: cbrt.hpp:245
auto cos(E &&value) -> detail::unary_helper< E, cos_unary_op >
Apply cosinus on each value of the given expression.
Definition: function_expression_builder.hpp:104
Root namespace for the ETL library.
Definition: adapter.hpp:15
static constexpr bool thread_safe
Indicates if the operator is thread safe or not.
Definition: cbrt.hpp:21
static std::string desc() noexcept
Returns a textual representation of the operator.
Definition: cbrt.hpp:96
std::complex< TT > T
The real type.
Definition: cbrt.hpp:106
static constexpr bool vectorizable
Indicates if the expression is vectorizable using the given vector mode.
Definition: cbrt.hpp:29
static constexpr bool linear
Indicates if the operator is linear.
Definition: cbrt.hpp:20
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 std::string desc() noexcept
Returns a textual representation of the operator.
Definition: cbrt.hpp:190
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: cbrt.hpp:35
EGBLAS wrappers for the cbrt operation.
static Y & gpu_compute(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: cbrt.hpp:262
static constexpr int complexity()
Estimate the complexity of operator.
Definition: cbrt.hpp:42
static constexpr T apply(const T &z)
Apply the unary operator on x.
Definition: cbrt.hpp:139
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 auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: cbrt.hpp:63
static auto gpu_compute_hint(const X &x, Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: cbrt.hpp:157
T arg(complex< T > z)
Computes the phase angle of the given complex number.
Definition: complex.hpp:311