15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 28 #ifdef EGBLAS_HAS_MSE_SLOSS 29 static constexpr
bool has_mse_sloss =
true;
31 static constexpr
bool has_mse_sloss =
false;
43 inline float mse_loss([[maybe_unused]]
size_t n,
44 [[maybe_unused]]
float alpha,
45 [[maybe_unused]]
const float* A,
46 [[maybe_unused]]
size_t lda,
47 [[maybe_unused]]
const float* B,
48 [[maybe_unused]]
size_t ldb) {
49 #ifdef EGBLAS_HAS_MSE_SLOSS 51 return egblas_mse_sloss(n, alpha, A, lda, B, ldb);
53 cpp_unreachable(
"Invalid call to egblas::mse_loss");
62 #ifdef EGBLAS_HAS_MSE_DLOSS 63 static constexpr
bool has_mse_dloss =
true;
65 static constexpr
bool has_mse_dloss =
false;
77 inline double mse_loss([[maybe_unused]]
size_t n,
78 [[maybe_unused]]
double alpha,
79 [[maybe_unused]]
const double* A,
80 [[maybe_unused]]
size_t lda,
81 [[maybe_unused]]
const double* B,
82 [[maybe_unused]]
size_t ldb) {
83 #ifdef EGBLAS_HAS_MSE_DLOSS 85 return egblas_mse_dloss(n, alpha, A, lda, B, ldb);
87 cpp_unreachable(
"Invalid call to egblas::mse_loss");
96 #ifdef EGBLAS_HAS_MSE_SERROR 97 static constexpr
bool has_mse_serror =
true;
99 static constexpr
bool has_mse_serror =
false;
111 inline float mse_error([[maybe_unused]]
size_t n,
112 [[maybe_unused]]
float alpha,
113 [[maybe_unused]]
const float* A,
114 [[maybe_unused]]
size_t lda,
115 [[maybe_unused]]
const float* B,
116 [[maybe_unused]]
size_t ldb) {
117 #ifdef EGBLAS_HAS_MSE_SERROR 119 return egblas_mse_serror(n, alpha, A, lda, B, ldb);
121 cpp_unreachable(
"Invalid call to egblas::mse_error");
130 #ifdef EGBLAS_HAS_MSE_DERROR 131 static constexpr
bool has_mse_derror =
true;
133 static constexpr
bool has_mse_derror =
false;
145 inline double mse_error([[maybe_unused]]
size_t n,
146 [[maybe_unused]]
double alpha,
147 [[maybe_unused]]
const double* A,
148 [[maybe_unused]]
size_t lda,
149 [[maybe_unused]]
const double* B,
150 [[maybe_unused]]
size_t ldb) {
151 #ifdef EGBLAS_HAS_MSE_DERROR 153 return egblas_mse_derror(n, alpha, A, lda, B, ldb);
155 cpp_unreachable(
"Invalid call to egblas::mse_error");
164 #ifdef EGBLAS_HAS_SMSE 165 static constexpr
bool has_smse =
true;
167 static constexpr
bool has_smse =
false;
179 inline std::pair<float, float> mse([[maybe_unused]]
size_t n,
180 [[maybe_unused]]
float alpha,
181 [[maybe_unused]]
float beta,
182 [[maybe_unused]]
const float* A,
183 [[maybe_unused]]
size_t lda,
184 [[maybe_unused]]
const float* B,
185 [[maybe_unused]]
size_t ldb) {
186 #ifdef EGBLAS_HAS_SMSE 188 return egblas_smse(n, alpha, beta, A, lda, B, ldb);
190 cpp_unreachable(
"Invalid call to egblas::mse");
192 return std::make_pair(0.0f, 0.0f);
199 #ifdef EGBLAS_HAS_DMSE 200 static constexpr
bool has_dmse =
true;
202 static constexpr
bool has_dmse =
false;
214 inline std::pair<double, double> mse([[maybe_unused]]
size_t n,
215 [[maybe_unused]]
double alpha,
216 [[maybe_unused]]
double beta,
217 [[maybe_unused]]
const double* A,
218 [[maybe_unused]]
size_t lda,
219 [[maybe_unused]]
const double* B,
220 [[maybe_unused]]
size_t ldb) {
221 #ifdef EGBLAS_HAS_DMSE 223 return egblas_dmse(n, alpha, beta, A, lda, B, ldb);
225 cpp_unreachable(
"Invalid call to egblas::mse");
227 return std::make_pair(0.0, 0.0);
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25