15 #ifdef ETL_EGBLAS_MODE 17 #include "etl/impl/cublas/cuda.hpp" 30 #ifdef EGBLAS_HAS_BERNOULLI_SAMPLE_PREPARE 31 static constexpr
bool has_bernoulli_sample_prepare =
true;
33 static constexpr
bool has_bernoulli_sample_prepare =
false;
41 #ifdef EGBLAS_HAS_BERNOULLI_SAMPLE_PREPARE 43 return egblas_bernoulli_sample_prepare();
45 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample_prepare");
53 #ifdef EGBLAS_HAS_BERNOULLI_SAMPLE_PREPARE_SEED 54 static constexpr
bool has_bernoulli_sample_prepare_seed =
true;
56 static constexpr
bool has_bernoulli_sample_prepare_seed =
false;
65 #ifdef EGBLAS_HAS_BERNOULLI_SAMPLE_PREPARE_SEED 67 return egblas_bernoulli_sample_prepare_seed(seed);
69 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample_prepare_seed");
77 #ifdef EGBLAS_HAS_BERNOULLI_SAMPLE_RELEASE 78 static constexpr
bool has_bernoulli_sample_release =
true;
80 static constexpr
bool has_bernoulli_sample_release =
false;
89 #ifdef EGBLAS_HAS_BERNOULLI_SAMPLE_RELEASE 91 egblas_bernoulli_sample_release(state);
93 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample_release");
102 #ifdef EGBLAS_HAS_SBERNOULLI_SAMPLE 103 static constexpr
bool has_sbernoulli_sample =
true;
105 static constexpr
bool has_sbernoulli_sample =
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_SBERNOULLI_SAMPLE 125 egblas_sbernoulli_sample(n, alpha, A, lda, C, ldc);
127 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample");
134 #ifdef EGBLAS_HAS_DBERNOULLI_SAMPLE 135 static constexpr
bool has_dbernoulli_sample =
true;
137 static constexpr
bool has_dbernoulli_sample =
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_DBERNOULLI_SAMPLE 157 egblas_dbernoulli_sample(n, alpha, A, lda, C, ldc);
159 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample");
168 #ifdef EGBLAS_HAS_SBERNOULLI_SAMPLE_SEED 169 static constexpr
bool has_sbernoulli_sample_seed =
true;
171 static constexpr
bool has_sbernoulli_sample_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_SBERNOULLI_SAMPLE_SEED 192 egblas_sbernoulli_sample_seed(n, alpha, A, lda, C, ldc, seed);
194 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample");
201 #ifdef EGBLAS_HAS_DBERNOULLI_SAMPLE_SEED 202 static constexpr
bool has_dbernoulli_sample_seed =
true;
204 static constexpr
bool has_dbernoulli_sample_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_DBERNOULLI_SAMPLE_SEED 225 egblas_dbernoulli_sample_seed(n, alpha, A, lda, C, ldc, seed);
227 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample");
236 #ifdef EGBLAS_HAS_SBERNOULLI_SAMPLE_STATES 237 static constexpr
bool has_sbernoulli_sample_states =
true;
239 static constexpr
bool has_sbernoulli_sample_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_SBERNOULLI_SAMPLE_STATES 260 egblas_sbernoulli_sample_states(n, alpha, A, lda, C, ldc, states);
262 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample_states");
269 #ifdef EGBLAS_HAS_DBERNOULLI_SAMPLE_STATES 270 static constexpr
bool has_dbernoulli_sample_states =
true;
272 static constexpr
bool has_dbernoulli_sample_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_DBERNOULLI_SAMPLE_STATES 293 egblas_dbernoulli_sample_states(n, alpha, A, lda, C, ldc, states);
295 cpp_unreachable(
"Invalid call to egblas::bernoulli_sample_states");
void bernoulli_sample_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 bernoulli_sample.
Definition: bernoulli.hpp:183
void bernoulli_sample_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 bernoulli_sample.
Definition: bernoulli.hpp:251
void * bernoulli_sample_prepare_seed([[maybe_unused]] size_t seed)
Prepare random states for bernoulli_sample with the given seed.
Definition: bernoulli.hpp:64
void * bernoulli_sample_prepare()
Prepare random states for bernoulli_sample.
Definition: bernoulli.hpp:40
void inc_counter([[maybe_unused]] const char *name)
Increase the given counter.
Definition: counters.hpp:25
void bernoulli_sample([[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)
Wrappers for single-precision egblas bernoulli_sample.
Definition: bernoulli.hpp:117
void bernoulli_sample_release([[maybe_unused]] void *state)
Prepare random states for bernoulli_sample with the given seed.
Definition: bernoulli.hpp:88