15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 18 #include "etl/util/counters.hpp" 29 #ifdef EGBLAS_HAS_SBIAS_ADD_2D 30 static constexpr
bool has_sbias_add_2d =
true;
32 static constexpr
bool has_sbias_add_2d =
false;
47 [[maybe_unused]]
size_t n,
48 [[maybe_unused]]
const float* x,
49 [[maybe_unused]]
size_t incx,
50 [[maybe_unused]]
const float* b,
51 [[maybe_unused]]
size_t incb,
52 [[maybe_unused]]
float* y,
53 [[maybe_unused]]
size_t incy) {
54 #ifdef EGBLAS_HAS_SBIAS_ADD_2D 56 egblas_sbias_add_2d(m, n, x, incx, b, incb, y, incy);
58 cpp_unreachable(
"Invalid call to egblas::bias_add_2d");
65 #ifdef EGBLAS_HAS_DBIAS_ADD_2D 66 static constexpr
bool has_dbias_add_2d =
true;
68 static constexpr
bool has_dbias_add_2d =
false;
83 [[maybe_unused]]
size_t n,
84 [[maybe_unused]]
const double* x,
85 [[maybe_unused]]
size_t incx,
86 [[maybe_unused]]
const double* b,
87 [[maybe_unused]]
size_t incb,
88 [[maybe_unused]]
double* y,
89 [[maybe_unused]]
size_t incy) {
90 #ifdef EGBLAS_HAS_DBIAS_ADD_2D 92 egblas_dbias_add_2d(m, n, x, incx, b, incb, y, incy);
94 cpp_unreachable(
"Invalid call to egblas::bias_add_2d");
101 #ifdef EGBLAS_HAS_SBIAS_ADD_4D 102 static constexpr
bool has_sbias_add_4d =
true;
104 static constexpr
bool has_sbias_add_4d =
false;
119 [[maybe_unused]]
size_t n,
120 [[maybe_unused]]
size_t o,
121 [[maybe_unused]]
size_t p,
122 [[maybe_unused]]
const float* x,
123 [[maybe_unused]]
size_t incx,
124 [[maybe_unused]]
const float* b,
125 [[maybe_unused]]
size_t incb,
126 [[maybe_unused]]
float* y,
127 [[maybe_unused]]
size_t incy) {
128 #ifdef EGBLAS_HAS_SBIAS_ADD_4D 130 egblas_sbias_add_4d(m, n, o, p, x, incx, b, incb, y, incy);
132 cpp_unreachable(
"Invalid call to egblas::bias_add_4d");
139 #ifdef EGBLAS_HAS_DBIAS_ADD_4D 140 static constexpr
bool has_dbias_add_4d =
true;
142 static constexpr
bool has_dbias_add_4d =
false;
157 [[maybe_unused]]
size_t n,
158 [[maybe_unused]]
size_t o,
159 [[maybe_unused]]
size_t p,
160 [[maybe_unused]]
const double* x,
161 [[maybe_unused]]
size_t incx,
162 [[maybe_unused]]
const double* b,
163 [[maybe_unused]]
size_t incb,
164 [[maybe_unused]]
double* y,
165 [[maybe_unused]]
size_t incy) {
166 #ifdef EGBLAS_HAS_DBIAS_ADD_4D 168 egblas_dbias_add_4d(m, n, o, p, x, incx, b, incb, y, incy);
170 cpp_unreachable(
"Invalid call to egblas::bias_add_4d");
bias_add_2d_expr< detail::build_type< E >, detail::build_type< B > > bias_add_2d(const E &x, const B &biases)
Returns the result of adding the bias [K] to the 4D matrix [N1, K, N2, N3].
Definition: bias_add_2d_expr.hpp:378
bias_add_4d_expr< detail::build_type< E >, detail::build_type< B > > bias_add_4d(const E &x, const B &biases)
Returns the result of adding the bias [K] to the 4D matrix [N1, K, N2, N3].
Definition: bias_add_4d_expr.hpp:388
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25