15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 28 #ifdef EGBLAS_HAS_CCE_SLOSS 29 static constexpr
bool has_cce_sloss =
true;
31 static constexpr
bool has_cce_sloss =
false;
43 inline float cce_loss([[maybe_unused]]
size_t n,
44 [[maybe_unused]]
float alpha,
45 [[maybe_unused]]
float* A,
46 [[maybe_unused]]
size_t lda,
47 [[maybe_unused]]
float* B,
48 [[maybe_unused]]
size_t ldb) {
49 #ifdef EGBLAS_HAS_CCE_SLOSS 51 return egblas_cce_sloss(n, alpha, A, lda, B, ldb);
53 cpp_unreachable(
"Invalid call to egblas::cce_loss");
62 #ifdef EGBLAS_HAS_CCE_DLOSS 63 static constexpr
bool has_cce_dloss =
true;
65 static constexpr
bool has_cce_dloss =
false;
77 inline double cce_loss([[maybe_unused]]
size_t n,
78 [[maybe_unused]]
double alpha,
79 [[maybe_unused]]
double* A,
80 [[maybe_unused]]
size_t lda,
81 [[maybe_unused]]
double* B,
82 [[maybe_unused]]
size_t ldb) {
83 #ifdef EGBLAS_HAS_CCE_DLOSS 85 return egblas_cce_dloss(n, alpha, A, lda, B, ldb);
87 cpp_unreachable(
"Invalid call to egblas::cce_loss");
96 #ifdef EGBLAS_HAS_CCE_SERROR 97 static constexpr
bool has_cce_serror =
true;
99 static constexpr
bool has_cce_serror =
false;
111 inline float cce_error(
112 [[maybe_unused]]
size_t n, [[maybe_unused]]
size_t m, [[maybe_unused]]
float alpha, [[maybe_unused]]
float* A, [[maybe_unused]]
float* B) {
113 #ifdef EGBLAS_HAS_CCE_SERROR 115 return egblas_cce_serror(n, m, alpha, A, B);
117 cpp_unreachable(
"Invalid call to egblas::cce_error");
126 #ifdef EGBLAS_HAS_CCE_DERROR 127 static constexpr
bool has_cce_derror =
true;
129 static constexpr
bool has_cce_derror =
false;
141 inline double cce_error(
142 [[maybe_unused]]
size_t n, [[maybe_unused]]
size_t m, [[maybe_unused]]
double alpha, [[maybe_unused]]
double* A, [[maybe_unused]]
double* B) {
143 #ifdef EGBLAS_HAS_CCE_DERROR 145 return egblas_cce_derror(n, m, alpha, A, B);
147 cpp_unreachable(
"Invalid call to egblas::cce_error");
156 #ifdef EGBLAS_HAS_SCCE 157 static constexpr
bool has_scce =
true;
159 static constexpr
bool has_scce =
false;
171 inline std::pair<float, float> cce([[maybe_unused]]
size_t n,
172 [[maybe_unused]]
size_t m,
173 [[maybe_unused]]
float alpha,
174 [[maybe_unused]]
float beta,
175 [[maybe_unused]]
float* A,
176 [[maybe_unused]]
float* B) {
177 #ifdef EGBLAS_HAS_SCCE 179 return egblas_scce(n, m, alpha, beta, A, B);
181 cpp_unreachable(
"Invalid call to egblas::cce");
183 return std::make_pair(0.0f, 0.0f);
190 #ifdef EGBLAS_HAS_DCCE 191 static constexpr
bool has_dcce =
true;
193 static constexpr
bool has_dcce =
false;
205 inline std::pair<double, double> cce([[maybe_unused]]
size_t n,
206 [[maybe_unused]]
size_t m,
207 [[maybe_unused]]
double alpha,
208 [[maybe_unused]]
double beta,
209 [[maybe_unused]]
double* A,
210 [[maybe_unused]]
double* B) {
211 #ifdef EGBLAS_HAS_DCCE 213 return egblas_dcce(n, m, alpha, beta, A, B);
215 cpp_unreachable(
"Invalid call to egblas::cce");
217 return std::make_pair(0.0, 0.0);
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25