15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 25 #ifdef EGBLAS_HAS_SAXPY 26 static constexpr
bool has_saxpy =
true;
28 static constexpr
bool has_saxpy =
false;
40 inline void axpy([[maybe_unused]]
size_t n,
41 [[maybe_unused]]
float alpha,
42 [[maybe_unused]]
const float* A,
43 [[maybe_unused]]
size_t lda,
44 [[maybe_unused]]
float* B,
45 [[maybe_unused]]
size_t ldb) {
46 #ifdef EGBLAS_HAS_SAXPY 48 egblas_saxpy(n, alpha, A, lda, B, ldb);
50 cpp_unreachable(
"Invalid call to egblas::axpy");
54 #ifdef EGBLAS_HAS_DAXPY 55 static constexpr
bool has_daxpy =
true;
57 static constexpr
bool has_daxpy =
false;
69 inline void axpy([[maybe_unused]]
size_t n,
70 [[maybe_unused]]
double alpha,
71 [[maybe_unused]]
const double* A,
72 [[maybe_unused]]
size_t lda,
73 [[maybe_unused]]
double* B,
74 [[maybe_unused]]
size_t ldb) {
75 #ifdef EGBLAS_HAS_DAXPY 77 egblas_daxpy(n, alpha, A, lda, B, ldb);
79 cpp_unreachable(
"Invalid call to egblas::axpy");
83 #ifdef EGBLAS_HAS_CAXPY 84 static constexpr
bool has_caxpy =
true;
86 static constexpr
bool has_caxpy =
false;
98 inline void axpy([[maybe_unused]]
size_t n,
99 [[maybe_unused]] std::complex<float> alpha,
100 [[maybe_unused]]
const std::complex<float>* A,
101 [[maybe_unused]]
size_t lda,
102 [[maybe_unused]] std::complex<float>* B,
103 [[maybe_unused]]
size_t ldb) {
104 #ifdef EGBLAS_HAS_CAXPY 106 egblas_caxpy(n, complex_cast(alpha), reinterpret_cast<cuComplex*>(A), lda, reinterpret_cast<cuComplex*>(B), ldb);
108 cpp_unreachable(
"Invalid call to egblas::axpy");
121 inline void axpy([[maybe_unused]]
size_t n,
124 [[maybe_unused]]
size_t lda,
126 [[maybe_unused]]
size_t ldb) {
127 #ifdef EGBLAS_HAS_CAXPY 129 egblas_caxpy(n, complex_cast(alpha), reinterpret_cast<cuComplex*>(A), lda, reinterpret_cast<cuComplex*>(B), ldb);
131 cpp_unreachable(
"Invalid call to egblas::axpy");
135 #ifdef EGBLAS_HAS_ZAXPY 136 static constexpr
bool has_zaxpy =
true;
138 static constexpr
bool has_zaxpy =
false;
150 inline void axpy([[maybe_unused]]
size_t n,
151 [[maybe_unused]] std::complex<double> alpha,
152 [[maybe_unused]]
const std::complex<double>* A,
153 [[maybe_unused]]
size_t lda,
154 [[maybe_unused]] std::complex<double>* B,
155 [[maybe_unused]]
size_t ldb) {
156 #ifdef EGBLAS_HAS_ZAXPY 158 egblas_zaxpy(n, complex_cast(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda, reinterpret_cast<cuDoubleComplex*>(B), ldb);
160 cpp_unreachable(
"Invalid call to egblas::axpy");
173 inline void axpy([[maybe_unused]]
size_t n,
176 [[maybe_unused]]
size_t lda,
178 [[maybe_unused]]
size_t ldb) {
179 #ifdef EGBLAS_HAS_ZAXPY 181 egblas_zaxpy(n, complex_cast(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda, reinterpret_cast<cuDoubleComplex*>(B), ldb);
183 cpp_unreachable(
"Invalid call to egblas::axpy");
Complex number implementation.
Definition: complex.hpp:31
void axpy([[maybe_unused]] size_t n, [[maybe_unused]] float alpha, [[maybe_unused]] const float *A, [[maybe_unused]] size_t lda, [[maybe_unused]] float *B, [[maybe_unused]] size_t ldb)
Wrappers for single-precision egblas axpy operation.
Definition: axpy.hpp:40
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25