15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 30 #ifdef EGBLAS_HAS_LOGISTIC_NOISE_PREPARE 31 static constexpr
bool has_logistic_noise_prepare =
true;
33 static constexpr
bool has_logistic_noise_prepare =
false;
41 #ifdef EGBLAS_HAS_LOGISTIC_NOISE_PREPARE 43 return egblas_logistic_noise_prepare();
45 cpp_unreachable(
"Invalid call to egblas::logistic_noise_prepare");
53 #ifdef EGBLAS_HAS_LOGISTIC_NOISE_PREPARE_SEED 54 static constexpr
bool has_logistic_noise_prepare_seed =
true;
56 static constexpr
bool has_logistic_noise_prepare_seed =
false;
65 #ifdef EGBLAS_HAS_LOGISTIC_NOISE_PREPARE_SEED 67 return egblas_logistic_noise_prepare_seed(seed);
69 cpp_unreachable(
"Invalid call to egblas::logistic_noise_prepare_seed");
77 #ifdef EGBLAS_HAS_LOGISTIC_NOISE_RELEASE 78 static constexpr
bool has_logistic_noise_release =
true;
80 static constexpr
bool has_logistic_noise_release =
false;
89 #ifdef EGBLAS_HAS_LOGISTIC_NOISE_RELEASE 91 egblas_logistic_noise_release(state);
93 cpp_unreachable(
"Invalid call to egblas::logistic_noise_release");
102 #ifdef EGBLAS_HAS_SLOGISTIC_NOISE 103 static constexpr
bool has_slogistic_noise =
true;
105 static constexpr
bool has_slogistic_noise =
false;
118 [[maybe_unused]]
float alpha,
119 [[maybe_unused]]
const float* A,
120 [[maybe_unused]]
size_t lda,
121 [[maybe_unused]]
float* C,
122 [[maybe_unused]]
size_t ldc) {
123 #ifdef EGBLAS_HAS_SLOGISTIC_NOISE 125 egblas_slogistic_noise(n, alpha, A, lda, C, ldc);
127 cpp_unreachable(
"Invalid call to egblas::logistic_noise");
134 #ifdef EGBLAS_HAS_DLOGISTIC_NOISE 135 static constexpr
bool has_dlogistic_noise =
true;
137 static constexpr
bool has_dlogistic_noise =
false;
150 [[maybe_unused]]
double alpha,
151 [[maybe_unused]]
const double* A,
152 [[maybe_unused]]
size_t lda,
153 [[maybe_unused]]
double* C,
154 [[maybe_unused]]
size_t ldc) {
155 #ifdef EGBLAS_HAS_DLOGISTIC_NOISE 157 egblas_dlogistic_noise(n, alpha, A, lda, C, ldc);
159 cpp_unreachable(
"Invalid call to egblas::logistic_noise");
168 #ifdef EGBLAS_HAS_SLOGISTIC_NOISE_SEED 169 static constexpr
bool has_slogistic_noise_seed =
true;
171 static constexpr
bool has_slogistic_noise_seed =
false;
184 [[maybe_unused]]
float alpha,
185 [[maybe_unused]]
const float* A,
186 [[maybe_unused]]
size_t lda,
187 [[maybe_unused]]
float* C,
188 [[maybe_unused]]
size_t ldc,
189 [[maybe_unused]]
size_t seed) {
190 #ifdef EGBLAS_HAS_SLOGISTIC_NOISE_SEED 192 egblas_slogistic_noise_seed(n, alpha, A, lda, C, ldc, seed);
194 cpp_unreachable(
"Invalid call to egblas::logistic_noise");
201 #ifdef EGBLAS_HAS_DLOGISTIC_NOISE_SEED 202 static constexpr
bool has_dlogistic_noise_seed =
true;
204 static constexpr
bool has_dlogistic_noise_seed =
false;
217 [[maybe_unused]]
double alpha,
218 [[maybe_unused]]
const double* A,
219 [[maybe_unused]]
size_t lda,
220 [[maybe_unused]]
double* C,
221 [[maybe_unused]]
size_t ldc,
222 [[maybe_unused]]
size_t seed) {
223 #ifdef EGBLAS_HAS_DLOGISTIC_NOISE_SEED 225 egblas_dlogistic_noise_seed(n, alpha, A, lda, C, ldc, seed);
227 cpp_unreachable(
"Invalid call to egblas::logistic_noise");
236 #ifdef EGBLAS_HAS_SLOGISTIC_NOISE_STATES 237 static constexpr
bool has_slogistic_noise_states =
true;
239 static constexpr
bool has_slogistic_noise_states =
false;
252 [[maybe_unused]]
float alpha,
253 [[maybe_unused]]
const float* A,
254 [[maybe_unused]]
size_t lda,
255 [[maybe_unused]]
float* C,
256 [[maybe_unused]]
size_t ldc,
257 [[maybe_unused]]
void* states) {
258 #ifdef EGBLAS_HAS_SLOGISTIC_NOISE_STATES 260 egblas_slogistic_noise_states(n, alpha, A, lda, C, ldc, states);
262 cpp_unreachable(
"Invalid call to egblas::logistic_noise_states");
269 #ifdef EGBLAS_HAS_DLOGISTIC_NOISE_STATES 270 static constexpr
bool has_dlogistic_noise_states =
true;
272 static constexpr
bool has_dlogistic_noise_states =
false;
285 [[maybe_unused]]
double alpha,
286 [[maybe_unused]]
const double* A,
287 [[maybe_unused]]
size_t lda,
288 [[maybe_unused]]
double* C,
289 [[maybe_unused]]
size_t ldc,
290 [[maybe_unused]]
void* states) {
291 #ifdef EGBLAS_HAS_DLOGISTIC_NOISE_STATES 293 egblas_dlogistic_noise_states(n, alpha, A, lda, C, ldc, states);
295 cpp_unreachable(
"Invalid call to egblas::logistic_noise_states");
void logistic_noise_states([[maybe_unused]] size_t n, [[maybe_unused]] float alpha, [[maybe_unused]] const float *A, [[maybe_unused]] size_t lda, [[maybe_unused]] float *C, [[maybe_unused]] size_t ldc, [[maybe_unused]] void *states)
Wrappers for single-precision egblas logistic_noise.
Definition: logistic_noise.hpp:251
void logistic_noise_seed([[maybe_unused]] size_t n, [[maybe_unused]] float alpha, [[maybe_unused]] const float *A, [[maybe_unused]] size_t lda, [[maybe_unused]] float *C, [[maybe_unused]] size_t ldc, [[maybe_unused]] size_t seed)
Wrappers for single-precision egblas logistic_noise.
Definition: logistic_noise.hpp:183
void * logistic_noise_prepare_seed([[maybe_unused]] size_t seed)
Prepare random states for logistic_noise with the given seed.
Definition: logistic_noise.hpp:64
auto logistic_noise(E &&value)
Add some normal noise (0, sigmoid(x)) to the given expression.
Definition: expression_builder.hpp:256
void logistic_noise_release([[maybe_unused]] void *state)
Prepare random states for logistic_noise with the given seed.
Definition: logistic_noise.hpp:88
void * logistic_noise_prepare()
Prepare random states for logistic_noise.
Definition: logistic_noise.hpp:40
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25