Expression Templates Library (ETL)
Macros | Functions
curand.hpp File Reference

Utility functions for curand. More...

#include "curand.h"
Include dependency graph for curand.hpp:

Go to the source code of this file.

Macros

#define curand_call(call)
 

Functions

void etl::impl::curand::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. More...
 
void etl::impl::curand::generate_normal (curandGenerator_t generator, double *gpu_memory, size_t n, double mean, double stddev)
 Generate a normal distribution with the given mean and standard deviation with CURAND, in double-precision. More...
 
void etl::impl::curand::generate_uniform (curandGenerator_t generator, float *gpu_memory, size_t n)
 Generate a uniform distribution between 0 and 1, in single precision. More...
 
void etl::impl::curand::generate_uniform (curandGenerator_t generator, double *gpu_memory, size_t n)
 Generate a uniform distribution between 0 and 1, in single precision. More...
 

Detailed Description

Utility functions for curand.

Macro Definition Documentation

◆ curand_call

#define curand_call (   call)
Value:
{ \
auto status = call; \
if (status != CURAND_STATUS_SUCCESS) { \
std::cerr << "CURAND error: " << status << " from " << #call << std::endl << "from " << __FILE__ << ":" << __LINE__ << std::endl; \
} \
}

Function Documentation

◆ generate_normal() [1/2]

void etl::impl::curand::generate_normal ( curandGenerator_t  generator,
float *  gpu_memory,
size_t  n,
float  mean,
float  stddev 
)
inline

Generate a normal distribution with the given mean and standard deviation with CURAND, in single-precision.

Parameters
generatorThe configured CURAND generator
gpu_memoryPointer to the GPU memory to fill
nThe number of elements to set
meanThe mean of the distribution to generate.
stddevThe standard deviation of the distribution to generate.

◆ generate_normal() [2/2]

void etl::impl::curand::generate_normal ( curandGenerator_t  generator,
double *  gpu_memory,
size_t  n,
double  mean,
double  stddev 
)
inline

Generate a normal distribution with the given mean and standard deviation with CURAND, in double-precision.

Parameters
generatorThe configured CURAND generator
gpu_memoryPointer to the GPU memory to fill
nThe number of elements to set
meanThe mean of the distribution to generate.
stddevThe standard deviation of the distribution to generate.

◆ generate_uniform() [1/2]

void etl::impl::curand::generate_uniform ( curandGenerator_t  generator,
float *  gpu_memory,
size_t  n 
)
inline

Generate a uniform distribution between 0 and 1, in single precision.

Parameters
generatorThe configured CURAND generator
gpu_memoryPointer to the GPU memory to fill
nThe number of elements to set

◆ generate_uniform() [2/2]

void etl::impl::curand::generate_uniform ( curandGenerator_t  generator,
double *  gpu_memory,
size_t  n 
)
inline

Generate a uniform distribution between 0 and 1, in single precision.

Parameters
generatorThe configured CURAND generator
gpu_memoryPointer to the GPU memory to fill
nThe number of elements to set