15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 25 #ifdef EGBLAS_HAS_SCALAR_SDIV 27 static constexpr
bool has_scalar_sdiv =
true;
36 inline void scalar_div(
float beta,
float* x,
size_t n,
size_t s) {
38 egblas_scalar_sdiv(beta, x, n, s);
43 static constexpr
bool has_scalar_sdiv =
false;
47 #ifdef EGBLAS_HAS_SCALAR_DDIV 49 static constexpr
bool has_scalar_ddiv =
true;
58 inline void scalar_div(
double beta,
double* x,
size_t n,
size_t s) {
60 egblas_scalar_ddiv(beta, x, n, s);
65 static constexpr
bool has_scalar_ddiv =
false;
69 #ifdef EGBLAS_HAS_SCALAR_CDIV 71 static constexpr
bool has_scalar_cdiv =
true;
80 inline void scalar_div(std::complex<float> beta, std::complex<float>* x,
size_t n,
size_t s) {
82 egblas_scalar_cdiv(complex_cast(beta), reinterpret_cast<cuComplex*>(x), n, s);
94 egblas_scalar_cdiv(complex_cast(beta), reinterpret_cast<cuComplex*>(x), n, s);
99 static constexpr
bool has_scalar_cdiv =
false;
103 #ifdef EGBLAS_HAS_SCALAR_ZDIV 105 static constexpr
bool has_scalar_zdiv =
true;
114 inline void scalar_div(std::complex<double> beta, std::complex<double>* x,
size_t n,
size_t s) {
116 egblas_scalar_zdiv(complex_cast(beta), reinterpret_cast<cuDoubleComplex*>(x), n, s);
128 egblas_scalar_zdiv(complex_cast(beta), reinterpret_cast<cuDoubleComplex*>(x), n, s);
133 static constexpr
bool has_scalar_zdiv =
false;
137 #ifndef ETL_EGBLAS_MODE 146 template <
typename T>
147 inline void scalar_div([[maybe_unused]] T beta, [[maybe_unused]] T* x, [[maybe_unused]]
size_t n, [[maybe_unused]]
size_t s) {
148 cpp_unreachable(
"Invalid call to egblas::scalar_div");
auto s(T &&value)
Force the evaluation of the given expression.
Definition: stop.hpp:18
Complex number implementation.
Definition: complex.hpp:31
void scalar_div([[maybe_unused]] T beta, [[maybe_unused]] T *x, [[maybe_unused]] size_t n, [[maybe_unused]] size_t s)
Divide the scalar beta by each element of the single-precision vector x.
Definition: scalar_div.hpp:147
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25