19 #define curand_call(call) \ 22 if (status != CURAND_STATUS_SUCCESS) { \ 23 std::cerr << "CURAND error: " << status << " from " << #call << std::endl << "from " << __FILE__ << ":" << __LINE__ << std::endl; \ 41 curand_call(curandGenerateNormal(generator, gpu_memory, n, mean, stddev));
44 curand_call(curandGenerateNormal(generator, gpu_memory, n - 1, mean, stddev));
47 curand_call(curandGenerateNormal(generator, gpu_memory + (n - 3), 2, mean, stddev));
65 curand_call(curandGenerateNormalDouble(generator, gpu_memory, n, mean, stddev));
68 curand_call(curandGenerateNormalDouble(generator, gpu_memory, n - 1, mean, stddev));
71 curand_call(curandGenerateNormalDouble(generator, gpu_memory + (n - 3), 2, mean, stddev));
84 curand_call(curandGenerateUniform(generator, gpu_memory, n));
96 curand_call(curandGenerateUniformDouble(generator, gpu_memory, n));
value_t< E > mean(E &&values)
Returns the mean of all the values contained in the given expression.
Definition: expression_builder.hpp:650
Definition: curand.hpp:17
value_t< E > stddev(E &&values)
Returns the standard deviation of all the values contained in the given expression.
Definition: expression_builder.hpp:670
void generate_uniform(curandGenerator_t generator, float *gpu_memory, size_t n)
Generate a uniform distribution between 0 and 1, in single precision.
Definition: curand.hpp:83
value_type * gpu_memory() const noexcept
Return GPU memory of this expression, if any.
Definition: sub_view.hpp:674
void generate_normal(curandGenerator_t generator, float *gpu_memory, size_t n, float mean, float stddev)
Generate a normal distribution with the given mean and standard deviation with CURAND, in single-precision.
Definition: curand.hpp:37