15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 25 #ifdef EGBLAS_HAS_SCALAR_SADD 27 static constexpr
bool has_scalar_sadd =
true;
36 inline void scalar_add(
float* x,
size_t n,
size_t s,
const float beta) {
38 egblas_scalar_sadd(x, n, s, beta);
43 static constexpr
bool has_scalar_sadd =
false;
47 #ifdef EGBLAS_HAS_SCALAR_DADD 49 static constexpr
bool has_scalar_dadd =
true;
58 inline void scalar_add(
double* x,
size_t n,
size_t s,
const double beta) {
60 egblas_scalar_dadd(x, n, s, beta);
65 static constexpr
bool has_scalar_dadd =
false;
69 #ifdef EGBLAS_HAS_SCALAR_CADD 71 static constexpr
bool has_scalar_cadd =
true;
82 egblas_scalar_cadd(reinterpret_cast<cuComplex*>(x), n, s, complex_cast(beta));
92 inline void scalar_add(std::complex<float>* x,
size_t n,
size_t s,
const std::complex<float> beta) {
94 egblas_scalar_cadd(reinterpret_cast<cuComplex*>(x), n, s, complex_cast(beta));
99 static constexpr
bool has_scalar_cadd =
false;
103 #ifdef EGBLAS_HAS_SCALAR_ZADD 105 static constexpr
bool has_scalar_zadd =
true;
116 egblas_scalar_zadd(reinterpret_cast<cuDoubleComplex*>(x), n, s, complex_cast(beta));
126 inline void scalar_add(std::complex<double>* x,
size_t n,
size_t s,
const std::complex<double> beta) {
128 egblas_scalar_zadd(reinterpret_cast<cuDoubleComplex*>(x), n, s, complex_cast(beta));
133 static constexpr
bool has_scalar_zadd =
false;
137 #ifndef ETL_EGBLAS_MODE 146 template <
typename T>
147 inline void scalar_add([[maybe_unused]] T* x, [[maybe_unused]]
size_t n, [[maybe_unused]]
size_t s, [[maybe_unused]]
const T beta) {
148 cpp_unreachable(
"Invalid call to egblas::scalar_add");
auto s(T &&value)
Force the evaluation of the given expression.
Definition: stop.hpp:18
Complex number implementation.
Definition: complex.hpp:31
void scalar_add([[maybe_unused]] T *x, [[maybe_unused]] size_t n, [[maybe_unused]] size_t s, [[maybe_unused]] const T beta)
Adds the scalar beta to each element of the single-precision vector x.
Definition: scalar_add.hpp:147
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25