15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 18 #include "etl/util/complex_cast.hpp" 30 #ifdef EGBLAS_HAS_SCLIP_VALUE 31 static constexpr
bool has_sclip_value =
true;
33 static constexpr
bool has_sclip_value =
false;
46 [[maybe_unused]]
const float alpha,
47 [[maybe_unused]]
float A,
48 [[maybe_unused]]
float B,
49 [[maybe_unused]]
float* C,
50 [[maybe_unused]]
size_t ldc) {
51 #ifdef EGBLAS_HAS_SCLIP_VALUE 53 egblas_sclip_value(n, alpha, A, B, C, ldc);
55 cpp_unreachable(
"Invalid call to egblas::clip_value");
62 #ifdef EGBLAS_HAS_DCLIP_VALUE 63 static constexpr
bool has_dclip_value =
true;
65 static constexpr
bool has_dclip_value =
false;
78 [[maybe_unused]]
double alpha,
79 [[maybe_unused]]
double A,
80 [[maybe_unused]]
double B,
81 [[maybe_unused]]
double* C,
82 [[maybe_unused]]
size_t ldc) {
83 #ifdef EGBLAS_HAS_DCLIP_VALUE 85 egblas_dclip_value(n, alpha, A, B, C, ldc);
87 cpp_unreachable(
"Invalid call to egblas::clip_value");
94 #ifdef EGBLAS_HAS_CCLIP_VALUE 95 static constexpr
bool has_cclip_value =
true;
97 static constexpr
bool has_cclip_value =
false;
110 [[maybe_unused]]
const std::complex<float> alpha,
111 [[maybe_unused]] std::complex<float> A,
112 [[maybe_unused]] std::complex<float> B,
113 [[maybe_unused]] std::complex<float>* C,
114 [[maybe_unused]]
size_t ldc) {
115 #ifdef EGBLAS_HAS_CCLIP_VALUE 117 egblas_cclip_value(n, complex_cast(alpha), complex_cast(A), complex_cast(B), reinterpret_cast<cuComplex*>(C), ldc);
119 cpp_unreachable(
"Invalid call to egblas::clip_value");
137 [[maybe_unused]]
size_t ldc) {
138 #ifdef EGBLAS_HAS_CCLIP_VALUE 140 egblas_cclip_value(n, complex_cast(alpha), complex_cast(A), complex_cast(B), reinterpret_cast<cuComplex*>(C), ldc);
142 cpp_unreachable(
"Invalid call to egblas::clip_value");
149 #ifdef EGBLAS_HAS_ZCLIP_VALUE 150 static constexpr
bool has_zclip_value =
true;
152 static constexpr
bool has_zclip_value =
false;
165 [[maybe_unused]]
const std::complex<double> alpha,
166 [[maybe_unused]] std::complex<double> A,
167 [[maybe_unused]] std::complex<double> B,
168 [[maybe_unused]] std::complex<double>* C,
169 [[maybe_unused]]
size_t ldc) {
170 #ifdef EGBLAS_HAS_ZCLIP_VALUE 172 egblas_zclip_value(n, complex_cast(alpha), complex_cast(A), complex_cast(B), reinterpret_cast<cuDoubleComplex*>(C), ldc);
174 cpp_unreachable(
"Invalid call to egblas::clip_value");
192 [[maybe_unused]]
size_t ldc) {
193 #ifdef EGBLAS_HAS_ZCLIP_VALUE 195 egblas_zclip_value(n, complex_cast(alpha), complex_cast(A), complex_cast(B), reinterpret_cast<cuDoubleComplex*>(C), ldc);
197 cpp_unreachable(
"Invalid call to egblas::clip_value");
Complex number implementation.
Definition: complex.hpp:31
void clip_value([[maybe_unused]] size_t n, [[maybe_unused]] const float alpha, [[maybe_unused]] float A, [[maybe_unused]] float B, [[maybe_unused]] float *C, [[maybe_unused]] size_t ldc)
Wrappers for single-precision egblas clip_value operation.
Definition: clip_value.hpp:45
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25