Macros | Typedefs | Functions
mmc_rand_posix.h File Reference

An interface to use a 48bit multi-threaded GNU RNG. More...

#include <stdlib.h>
Include dependency graph for mmc_rand_posix.h:

Go to the source code of this file.

Macros

#define __device__   static inline
 
#define MCX_RNG_NAME   "POSIX Multi-threaded RNG"
 
#define RAND_BUF_LEN   3
 
#define RAND_SEED_WORD_LEN   2
 

Typedefs

typedef unsigned int uint
 
typedef unsigned short RandType
 

Functions

__device__ float rand_uniform01 (RandType t[RAND_BUF_LEN])
 
__device__ void rng_init (RandType t[RAND_BUF_LEN], RandType tnew[RAND_BUF_LEN], uint *n_seed, int idx)
 
__device__ void rand_need_more (RandType t[RAND_BUF_LEN], RandType tbuf[RAND_BUF_LEN])
 
__device__ float rand_next_scatlen (RandType t[RAND_BUF_LEN])
 generate [0,1] random number for the next scattering length
 
__device__ float rand_next_aangle (RandType t[RAND_BUF_LEN])
 generate [0,1] random number for the next arimuthal angle
 
__device__ float rand_next_zangle (RandType t[RAND_BUF_LEN])
 generate random number for the next zenith angle
 
__device__ float rand_next_reflect (RandType t[RAND_BUF_LEN])
 generate random number for reflection test
 
__device__ float rand_do_roulette (RandType t[RAND_BUF_LEN])
 generate random number for the next zenith angle
 

Detailed Description

An interface to use a 48bit multi-threaded GNU RNG.