15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 25 #ifdef EGBLAS_HAS_SAXPBY 26 static constexpr
bool has_saxpby =
true;
28 static constexpr
bool has_saxpby =
false;
40 inline void axpby([[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 beta,
45 [[maybe_unused]]
float* B,
46 [[maybe_unused]]
size_t ldb) {
47 #ifdef EGBLAS_HAS_SAXPBY 49 egblas_saxpby(n, alpha, A, lda, beta, B, ldb);
51 cpp_unreachable(
"Invalid call to egblas::axpby");
55 #ifdef EGBLAS_HAS_DAXPBY 56 static constexpr
bool has_daxpby =
true;
58 static constexpr
bool has_daxpby =
false;
70 inline void axpby([[maybe_unused]]
size_t n,
71 [[maybe_unused]]
double alpha,
72 [[maybe_unused]]
const double* A,
73 [[maybe_unused]]
size_t lda,
74 [[maybe_unused]]
double beta,
75 [[maybe_unused]]
double* B,
76 [[maybe_unused]]
size_t ldb) {
77 #ifdef EGBLAS_HAS_DAXPBY 79 egblas_daxpby(n, alpha, A, lda, beta, B, ldb);
81 cpp_unreachable(
"Invalid call to egblas::axpby");
85 #ifdef EGBLAS_HAS_CAXPBY 86 static constexpr
bool has_caxpby =
true;
88 static constexpr
bool has_caxpby =
false;
100 inline void axpby([[maybe_unused]]
size_t n,
101 [[maybe_unused]] std::complex<float> alpha,
102 [[maybe_unused]]
const std::complex<float>* A,
103 [[maybe_unused]]
size_t lda,
104 [[maybe_unused]] std::complex<float> beta,
105 [[maybe_unused]] std::complex<float>* B,
106 [[maybe_unused]]
size_t ldb) {
107 #ifdef EGBLAS_HAS_CAXPBY 109 egblas_caxpby(n, complex_cast(alpha), reinterpret_cast<cuComplex*>(A), lda, complex_cast(beta), reinterpret_cast<cuComplex*>(B), ldb);
111 cpp_unreachable(
"Invalid call to egblas::axpby");
124 inline void axpby([[maybe_unused]]
size_t n,
127 [[maybe_unused]]
size_t lda,
128 [[maybe_unused]] std::complex<float> beta,
130 [[maybe_unused]]
size_t ldb) {
131 #ifdef EGBLAS_HAS_CAXPBY 133 egblas_caxpby(n, complex_cast(alpha), reinterpret_cast<cuComplex*>(A), lda, complex_cast(beta), reinterpret_cast<cuComplex*>(B), ldb);
135 cpp_unreachable(
"Invalid call to egblas::axpby");
139 #ifdef EGBLAS_HAS_ZAXPBY 140 static constexpr
bool has_zaxpby =
true;
142 static constexpr
bool has_zaxpby =
false;
154 inline void axpby([[maybe_unused]]
size_t n,
155 [[maybe_unused]] std::complex<double> alpha,
156 [[maybe_unused]]
const std::complex<double>* A,
157 [[maybe_unused]]
size_t lda,
158 [[maybe_unused]] std::complex<double> beta,
159 [[maybe_unused]] std::complex<double>* B,
160 [[maybe_unused]]
size_t ldb) {
161 #ifdef EGBLAS_HAS_ZAXPBY 163 egblas_zaxpby(n, complex_cast(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda, complex_cast(beta), reinterpret_cast<cuDoubleComplex*>(B), ldb);
165 cpp_unreachable(
"Invalid call to egblas::axpby");
178 inline void axpby([[maybe_unused]]
size_t n,
181 [[maybe_unused]]
size_t lda,
182 [[maybe_unused]] std::complex<double> beta,
184 [[maybe_unused]]
size_t ldb) {
185 #ifdef EGBLAS_HAS_ZAXPBY 187 egblas_zaxpby(n, complex_cast(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda, complex_cast(beta), reinterpret_cast<cuDoubleComplex*>(B), ldb);
189 cpp_unreachable(
"Invalid call to egblas::axpby");
Complex number implementation.
Definition: complex.hpp:31
void axpby([[maybe_unused]] size_t n, [[maybe_unused]] float alpha, [[maybe_unused]] const float *A, [[maybe_unused]] size_t lda, [[maybe_unused]] float beta, [[maybe_unused]] float *B, [[maybe_unused]] size_t ldb)
Wrappers for single-precision egblas axpby operation.
Definition: axpby.hpp:40
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25