15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 28 #ifdef EGBLAS_HAS_SSQRT 29 static constexpr
bool has_ssqrt =
true;
31 static constexpr
bool has_ssqrt =
false;
43 inline void sqrt([[maybe_unused]]
size_t n,
44 [[maybe_unused]]
float alpha,
45 [[maybe_unused]]
float* A,
46 [[maybe_unused]]
size_t lda,
47 [[maybe_unused]]
float* B,
48 [[maybe_unused]]
size_t ldb) {
49 #ifdef EGBLAS_HAS_SSQRT 51 egblas_ssqrt(n, alpha, A, lda, B, ldb);
53 cpp_unreachable(
"Invalid call to egblas::sqrt");
60 #ifdef EGBLAS_HAS_DSQRT 61 static constexpr
bool has_dsqrt =
true;
63 static constexpr
bool has_dsqrt =
false;
75 inline void sqrt([[maybe_unused]]
size_t n,
76 [[maybe_unused]]
double alpha,
77 [[maybe_unused]]
double* A,
78 [[maybe_unused]]
size_t lda,
79 [[maybe_unused]]
double* B,
80 [[maybe_unused]]
size_t ldb) {
81 #ifdef EGBLAS_HAS_DSQRT 83 egblas_dsqrt(n, alpha, A, lda, B, ldb);
85 cpp_unreachable(
"Invalid call to egblas::sqrt");
93 #ifdef EGBLAS_HAS_CSQRT 94 static constexpr
bool has_csqrt =
true;
96 static constexpr
bool has_csqrt =
false;
108 inline void sqrt([[maybe_unused]]
size_t n,
109 [[maybe_unused]] std::complex<float> alpha,
110 [[maybe_unused]] std::complex<float>* A,
111 [[maybe_unused]]
size_t lda,
112 [[maybe_unused]] std::complex<float>* B,
113 [[maybe_unused]]
size_t ldb) {
114 #ifdef EGBLAS_HAS_CSQRT 116 egblas_csqrt(n, complex_cast(alpha), reinterpret_cast<cuComplex*>(A), lda, reinterpret_cast<cuComplex*>(B), ldb);
118 cpp_unreachable(
"Invalid call to egblas::sqrt");
131 inline void sqrt([[maybe_unused]]
size_t n,
134 [[maybe_unused]]
size_t lda,
136 [[maybe_unused]]
size_t ldb) {
137 #ifdef EGBLAS_HAS_CSQRT 139 egblas_csqrt(n, complex_cast(alpha), reinterpret_cast<cuComplex*>(A), lda, reinterpret_cast<cuComplex*>(B), ldb);
141 cpp_unreachable(
"Invalid call to egblas::sqrt");
149 #ifdef EGBLAS_HAS_ZSQRT 150 static constexpr
bool has_zsqrt =
true;
152 static constexpr
bool has_zsqrt =
false;
164 inline void sqrt([[maybe_unused]]
size_t n,
165 [[maybe_unused]] std::complex<double> alpha,
166 [[maybe_unused]] std::complex<double>* A,
167 [[maybe_unused]]
size_t lda,
168 [[maybe_unused]] std::complex<double>* B,
169 [[maybe_unused]]
size_t ldb) {
170 #ifdef EGBLAS_HAS_ZSQRT 172 egblas_zsqrt(n, complex_cast(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda, reinterpret_cast<cuDoubleComplex*>(B), ldb);
174 cpp_unreachable(
"Invalid call to egblas::sqrt");
187 inline void sqrt([[maybe_unused]]
size_t n,
190 [[maybe_unused]]
size_t lda,
192 [[maybe_unused]]
size_t ldb) {
193 #ifdef EGBLAS_HAS_ZSQRT 195 egblas_zsqrt(n, complex_cast(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda, reinterpret_cast<cuDoubleComplex*>(B), ldb);
197 cpp_unreachable(
"Invalid call to egblas::sqrt");
Complex number implementation.
Definition: complex.hpp:31
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
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25