跳到主要内容

muRAND API Reference

1 Introduction

The muRAND library provides functions mainly used to generate high-quality pseudo-random and quasi-random numbers. On top of Moore Threads® MUSA® runtime, this library provides access to parallel computational re- sources of Moore Threads Graphics Processing Unit (GPU) in a simple and efficient way.

The muRAND consists of random generation functions on the host and device sides. These functions can be called on either hosts or devices, but the random number generation is produced on devices only. In addition, the device side functions offer flexibility to self-define states of random-number generators.

The supported random number generators are listed as follows.

  • XORWOW
  • MRG32k3a
  • MTGP
  • Philox_4_32_
  • Sobol
  • Sobol
  • Scrambled Sobol
  • Scrambled Sobol

In this version, muRAND supports both single and double precision data types.

2 Module Index

2.1 Modules

Here is a list of all modules:

  • Host API
  • Device API

3 Module Documentation

3.1 Host API

Macros

  • #define MURAND_DEFAULT_MAX_BLOCK_SIZE 256

Typedefs

  • typedef enum murandStatus murandStatus_t Returns status codes.
  • typedef enum murandRngType murandRngType_t Random number generators are created by calling murandCreateGenerator(). These generators can divided into two groups as follows.
  • typedef enum murandOrdering murandOrdering_t The ordering of muRAND generators.

Enumerations

- enum murandStatus {
MURAND_STATUS_SUCCESS = 0 ,
MURAND_STATUS_VERSION_MISMATCH = 100 ,
MURAND_STATUS_NOT_CREATED = 101 ,
MURAND_STATUS_ALLOCATION_FAILED = 102 ,
MURAND_STATUS_TYPE_ERROR = 103 ,
MURAND_STATUS_OUT_OF_RANGE = 104 ,
MURAND_STATUS_LENGTH_NOT_MULTIPLE ,
MURAND_STATUS_DOUBLE_PRECISION_REQUIRED = 106 ,
MURAND_STATUS_LAUNCH_FAILURE = 107 ,
MURAND_STATUS_INTERNAL_ERROR = 108 ,
MURAND_STATUS_NOT_IMPLEMENTED = 1000 }
Returns status codes.


- enum murandRngType {
MURAND_RNG_PSEUDO_DEFAULT = 400 ,
MURAND_RNG_PSEUDO_XORWOW = 401 ,
MURAND_RNG_PSEUDO_MRG32K3A = 402 ,
MURAND_RNG_PSEUDO_MTGP32 = 403 ,
MURAND_RNG_PSEUDO_PHILOX4_32_10 = 404 ,
MURAND_RNG_QUASI_DEFAULT = 500 ,
MURAND_RNG_QUASI_SOBOL32 = 501 ,
MURAND_RNG_QUASI_SCRAMBLED_SOBOL32 = 502 ,
MURAND_RNG_QUASI_SOBOL64 = 504 ,
MURAND_RNG_QUASI_SCRAMBLED_SOBOL64 = 505 }
Random number generators are created by calling murandCreateGenerator(). These generators can divided into two
groups as follows.
- enum murandOrdering {
MURAND_ORDERING_PSEUDO_BEST = 100 ,
MURAND_ORDERING_PSEUDO_DEFAULT = 101 ,
MURAND_ORDERING_PSEUDO_SEEDED = 102 ,
MURAND_ORDERING_PSEUDO_LEGACY = 103 ,
MURAND_ORDERING_PSEUDO_DYNAMIC = 104 ,
MURAND_ORDERING_QUASI_DEFAULT = 201 }
The ordering of muRAND generators.
- enum murandDirectionVectorSet {
MURAND_DIRECTION_VECTORS_32_JOEKUO6 ,
MURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6 ,
MURAND_DIRECTION_VECTORS_64_JOEKUO6 ,
MURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6 }

Functions

  • murandStatus_t MURANDAPI murandCreateGenerator (murandGenerator_t∗generator, murandRngType_t rng_type) Creates a new random number generator.
  • murandStatus_t MURANDAPI murandDestroyGenerator (murandGenerator_t generator) Destroys the specified generator.
  • murandStatus_t MURANDAPI murandGenerate (murandGenerator_t generator, unsigned int∗output_data, size_t n) Generates uniformly distributed 32-bit unsigned integers.
  • murandStatus_t MURANDAPI murandGenerateLongLong (murandGenerator_t generator, unsigned long long int∗output_data, size_t n) Generates uniformly distributed 64-bit unsigned integers.
  • murandStatus_t MURANDAPI murandGenerateUniform (murandGenerator_t generator, float∗output_data, size_t n) Generates uniformly distributedfloatvalues.
  • murandStatus_t MURANDAPI murandGenerateUniformDouble (murandGenerator_t generator, double ∗output_data, size_t n) Generates uniformly distributed double-precision floating-point values.
  • murandStatus_t MURANDAPI murandGenerateNormal (murandGenerator_t generator, float∗output_data, size_t n, float mean, float stddev) Generates normally distributedfloatvalues.
  • murandStatus_t MURANDAPI murandGenerateNormalDouble (murandGenerator_t generator, double ∗output_data, size_t n, double mean, double stddev) Generates normally distributeddoublevalues.
  • murandStatus_t MURANDAPI murandGenerateLogNormal (murandGenerator_t generator, float∗output_←- data, size_t n, float mean, float stddev)
Generates log-normally distributedfloatvalues.
  • murandStatus_t MURANDAPI murandGenerateLogNormalDouble (murandGenerator_t generator, double ∗output_data, size_t n, double mean, double stddev) Generates log-normally distributeddoublevalues.
  • murandStatus_t MURANDAPI murandGeneratePoisson (murandGenerator_t generator, unsigned int ∗output_data, size_t n, double lambda) Generates Poisson-distributed 32-bit unsigned integers.
  • murandStatus_t MURANDAPI murandGenerateSeeds (murandGenerator_t generator) Setup starting states.
  • murandStatus_t MURANDAPI murandSetStream (murandGenerator_t generator, MUstream stream) Sets the current stream for kernel launches.
  • murandStatus_t MURANDAPI murandSetPseudoRandomGeneratorSeed (murandGenerator_t generator, unsigned long long seed) Sets the seed of the pseudo-random number generator.
  • murandStatus_t MURANDAPI murandSetGeneratorOffset (murandGenerator_t generator, unsigned long long offset) Sets the offset of the random number generator.
  • murandStatus_t MURANDAPI murandSetGeneratorOrdering (murandGenerator_t generator, murandOrdering_t order) Sets the order of the random number generator.
  • murandStatus_t MURANDAPI murandSetQuasiRandomGeneratorDimensions (murandGenerator_t genera- tor, unsigned int dimensions) Sets the number of dimensions of a quasi-random number generator.
  • murandStatus_t MURANDAPI murandGetVersion (int∗version) Returns the version of the library.
  • murandStatus_t MURANDAPI murandCreatePoissonDistribution (double lambda, murandDiscrete←- Distribution_t∗discrete_distribution) Constructs the histogram of the Poisson distribution.
  • murandStatus_t MURANDAPI murandDestroyDistribution (murandDiscreteDistribution_t discrete_←- distribution) Destroys the histogram array for the discrete distribution.
  • murandStatus_t MURANDAPI murandGetDirectionVectors32 (murandDirectionVectors32_t ∗vectors[ ], murandDirectionVectorSet_t set) Gets the direction vector used to generate a 32-bit quasi-random number.
  • murandStatus_t MURANDAPI murandGetScrambleConstants32 (unsigned int∗∗constants) Gets scramble constants for 32-bit scrambled Sobol'.
  • murandStatus_t MURANDAPI murandGetDirectionVectors64 (murandDirectionVectors64_t ∗vectors[ ], murandDirectionVectorSet_t set) Gets direction vectors for 64-bit quasirandom number generation.
  • murandStatus_t MURANDAPI murandGetScrambleConstants64 (unsigned long long∗∗constants) Gets scramble constants for 64-bit scrambled Sobol'.

3.1.1 Detailed Description

This section describes muRAND host API.

3.1.2 Enumeration Type Documentation

3.1.2.1 murandDirectionVectorSet

enum murandDirectionVectorSet MURAND array of 32-bit direction vectors. MURAND array of 64-bit direction vectors. MURAND choice of direction vector set.

Enumerator MURAND_DIRECTION_VECTORS_32_JOEKUO6 The specific set of 32-bit direction vectors generated from polynomials, up to 20,000 dimensions. MURAND_SCRAMBLED_DIRECTION_VECTORS←- _32_JOEKUO

The specific set of 32-bit direction vectors generated
from polynomials, up to 20,000 dimensions, and
scrambled.
MURAND_DIRECTION_VECTORS_64_JOEKUO6 The specific set of 64-bit direction vectors generated
from polynomials, up to 20,000 dimensions.
MURAND_SCRAMBLED_DIRECTION_VECTORS←-
_64_JOEKUO
The specific set of 64-bit direction vectors generated
from polynomials, up to 20,000 dimensions, and
scrambled.
3.1.2.2 murandOrdering

enum murandOrdering

The ordering of muRAND generators.

Enumerator MURAND_ORDERING_PSEUDO_BEST Optimal ordering of pseudorandom results. MURAND_ORDERING_PSEUDO_DEFAULT Default ordering of pseudorandom results. MURAND_ORDERING_PSEUDO_SEEDED Fast, lowe-quality pseudorandom results. MURAND_ORDERING_PSEUDO_LEGACY Legacy ordering of pseudorandom results. MURAND_ORDERING_PSEUDO_DYNAMIC Adjust the device executing the generator. MURAND_ORDERING_QUASI_DEFAULT n-dimensional ordering of quasirandom results.

3.1.2.3 murandRngType

enum murandRngType

Random number generators are created by calling murandCreateGenerator(). These generators can divided into two groups as follows.

Enumerator MURAND_RNG_PSEUDO_DEFAULT Default pseudorandom generator. MURAND_RNG_PSEUDO_XORWOW XORWOW pseudorandom generator. MURAND_RNG_PSEUDO_MRG32K3A MRG32k3a pseudorandom generator. MURAND_RNG_PSEUDO_MTGP32 Mersenne Twister MTGP32 pseudorandom generator. MURAND_RNG_PSEUDO_PHILOX4_32_10 PHILOX-4x32-10 pseudorandom generator. MURAND_RNG_QUASI_DEFAULT Default quasirandom generator. MURAND_RNG_QUASI_SOBOL32 Sobol32 quasirandom generator. MURAND_RNG_QUASI_SCRAMBLED_SOBOL32 Scrambled Sobol32 quasirandom generator. MURAND_RNG_QUASI_SOBOL64 Sobol64 quasirandom generator. MURAND_RNG_QUASI_SCRAMBLED_SOBOL64 Scrambled Sobol64 quasirandom generator.

3.1.2.4 murandStatus

enum murandStatus

Returns status codes.

Enumerator MURAND_STATUS_SUCCESS The muRAND operation was successful. MURAND_STATUS_VERSION_MISMATCH Unmatched header file and linked library version. MURAND_STATUS_NOT_CREATED The generator was not created by murandCreateGenerator(). MURAND_STATUS_ALLOCATION_FAILED Failed to allocate memory. MURAND_STATUS_TYPE_ERROR Generator type error. MURAND_STATUS_OUT_OF_RANGE The passed argument is out of range. MURAND_STATUS_LENGTH_NOT_MULTIPLE Requested size is not a multiple of quasirandom generator's dimension, or requested size is not even (see murandGenerateNormal()), or pointer is misaligned (see murandGenerateNormal()) MURAND_STATUS_DOUBLE_PRECISION_←- REQUIRED

Double precision is not supported on GPUs.
MURAND_STATUS_LAUNCH_FAILURE Failed to kernel launch.
MURAND_STATUS_INTERNAL_ERROR Internal library error.
MURAND_STATUS_NOT_IMPLEMENTED The function is not implemented yet.

3.1.3 Function Documentation

3.1.3.1 murandCreateGenerator()

murandStatus_t MURANDAPI murandCreateGenerator ( murandGenerator_t∗generator, murandRngType_trng_type)

Creates a new random number generator.

Creates a new random number generator of typerng_typeand returns it ingenerator.

Supportedrng_typeas follows:

  • MURAND_RNG_PSEUDO_XORWOW
  • MURAND_RNG_PSEUDO_MRG32K3A
  • MURAND_RNG_PSEUDO_MTGP
  • MURAND_RNG_PSEUDO_PHILOX4_32_
  • MURAND_RNG_QUASI_SOBOL
  • MURAND_RNG_QUASI_SCRAMBLED_SOBOL
  • MURAND_RNG_QUASI_SOBOL
  • MURAND_RNG_QUASI_SCRAMBLED_SOBOL

Parameters generator Pointer to generator. rng_type Type of generator to create.

Return values MURAND_STATUS_SUCCESS muRAND successfully created the generator. MURAND_STATUS_ALLOCATION_FAILED Failed to allocate memory. MURAND_STATUS_VERSION_MISMATCH The header file version and the dynamically linked library version are not match. MURAND_STATUS_TYPE_ERROR The value ofrng_typeis invalid.

3.1.3.2 murandCreatePoissonDistribution()

murandStatus_t MURANDAPI murandCreatePoissonDistribution ( doublelambda, murandDiscreteDistribution_t∗discrete_distribution)

Constructs the histogram of the Poisson distribution.

Constructs the histogram of the Poisson distribution with lambdalambda.

Parameters lambda - lambda for the Poisson distribution. discrete_distribution - Pointer to the histogram in device memory.

Return values MURAND_STATUS_SUCCESS If the histogram was constructed successfully. MURAND_STATUS_ALLOCATION_FAILED If memory could not be allocated. MURAND_STATUS_OUT_OF_RANGE Ifdiscrete_distributionpointer was null. MURAND_STATUS_OUT_OF_RANGE If lambda is non-positive.

3.1.3.3 murandDestroyDistribution()

murandStatus_t MURANDAPI murandDestroyDistribution ( murandDiscreteDistribution_tdiscrete_distribution)

Destroys the histogram array for the discrete distribution.

Destroys the histogram array for the discrete distribution created by murandCreatePoissonDistribution().

Parameters discrete_distribution - Pointer to the histogram in device memory.

Return values MURAND_STATUS_OUT_OF_RANGE Ifdiscrete_distributionwas null. MURAND_STATUS_SUCCESS If the histogram was destroyed successfully.

3.1.3.4 murandDestroyGenerator()

murandStatus_t MURANDAPI murandDestroyGenerator ( murandGenerator_tgenerator)

Destroys the specified generator.

Destroys a random number generator and frees related memory.

Parameters generator - Generator to be destroyed.

Return values MURAND_STATUS_SUCCESS muRAND successfully destroyed the generator. MURAND_STATUS_NOT_CREATED The generator was not created.

3.1.3.5 murandGenerate()

murandStatus_t MURANDAPI murandGenerate ( murandGenerator_tgenerator, unsigned int ∗output_data, size_tn)

Generates uniformly distributed 32-bit unsigned integers.

Generatesnuniformly distributed 32-bit unsigned integers and saves them tooutput_data.

The numbers are between 0 and 2 ∧ 32 , including 0 and excluding 2 ∧ 32.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of 32-bit unsigned integers to generate.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created.

Return values MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of the used quasi-random generator.

3.1.3.6 murandGenerateLogNormal()

murandStatus_t MURANDAPI murandGenerateLogNormal ( murandGenerator_tgenerator, float∗output_data, size_tn, floatmean, floatstddev)

Generates log-normally distributedfloatvalues.

Generatesnlog-normally distributed 32-bit floating-point values and saves them tooutput_data.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of floats to generate. mean - The mean value of log-normal distribution. stddev - The standard deviation value of log-normal distribution.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of used quasi-random generator.

3.1.3.7 murandGenerateLogNormalDouble()

murandStatus_t MURANDAPI murandGenerateLogNormalDouble ( murandGenerator_tgenerator, double∗output_data, size_tn, doublemean, doublestddev)

Generates log-normally distributeddoublevalues.

Generatesnlog-normally distributed 64-bit double-precision floating-point values and saves them tooutput_←- data.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of doubles to generate. mean - The mean value of log-normal distribution. stddev - The standard deviation value of log-normal distribution.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of the used quasi-random generator.

3.1.3.8 murandGenerateLongLong()

murandStatus_t MURANDAPI murandGenerateLongLong ( murandGenerator_tgenerator, unsigned long long int∗output_data, size_tn)

Generates uniformly distributed 64-bit unsigned integers.

Generatesnuniformly distributed 64-bit unsigned integers and saves them tooutput_data.

The numbers are between 0 and 2 ∧ 64 , including 0 and excluding 2 ∧ 64.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of 64-bit unsigned integers to generate.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of the used quasi-random generator. MURAND_TYPE_ERROR If the generator cannot generate 64-bit random numbers locally.

3.1.3.9 murandGenerateNormal()

murandStatus_t MURANDAPI murandGenerateNormal (

murandGenerator_tgenerator,
float∗output_data,
size_tn,
floatmean,
floatstddev)

Generates normally distributedfloatvalues.

Generatesnnormally distributed distributed 32-bit floating-point values and saves them tooutput_data.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of floats to generate. mean - The mean value of the normal distribution. stddev - The standard deviation value of the normal distribution.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of the used quasi-random generator.

3.1.3.10 murandGenerateNormalDouble()

murandStatus_t MURANDAPI murandGenerateNormalDouble ( murandGenerator_tgenerator, double∗output_data, size_tn, doublemean, doublestddev)

Generates normally distributeddoublevalues.

Generatesnnormally distributed 64-bit double-precision floating-point numbers and saves them tooutput_←- data.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of doubles to generate. mean - The mean value of the normal distribution. stddev - The standard deviation value of the normal distribution.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of the used quasi-random generator.

3.1.3.11 murandGeneratePoisson()

murandStatus_t MURANDAPI murandGeneratePoisson ( murandGenerator_tgenerator, unsigned int ∗output_data, size_tn, doublelambda)

Generates Poisson-distributed 32-bit unsigned integers.

GeneratesnPoisson-distributed 32-bit unsigned integers and saves them tooutput_data.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of 32-bit unsigned integers to generate. lambda - The lambda of the Poisson distribution.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_OUT_OF_RANGE If lambda is non-positive. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of the used quasi-random generator.

3.1.3.12 murandGenerateSeeds()

murandStatus_t MURANDAPI murandGenerateSeeds ( murandGenerator_tgenerator)

Setup starting states.

Initializes the state of the generator on GPU or host. Users do not need to call this function before using a generator.

If murand_initialize() was not called for a generator, it will be automatically called by a function that generates random numbers (such as murandGenerate(), etc.).

Parameters generator - Generator to initialize.

Return values MURAND_STATUS_SUCCESS If the seeds were generated successfully. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed.

3.1.3.13 murandGenerateUniform()

murandStatus_t MURANDAPI murandGenerateUniform ( murandGenerator_tgenerator, float∗output_data, size_tn)

Generates uniformly distributedfloatvalues.

Generatesnuniformly distributed 32-bit floating-point values and saves them tooutput_data.

The numbers are between0.0fand1.0f, excluding0.0fand including1.0f.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of floats to generate.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of the used quasi-random generator.

3.1.3.14 murandGenerateUniformDouble()

murandStatus_t MURANDAPI murandGenerateUniformDouble ( murandGenerator_tgenerator, double∗output_data, size_tn) Generates uniformly distributed double-precision floating-point values. Generatesnuniformly distributed 64-bit double-precision floating-point values and saves them tooutput_data. The numbers are between0.0and1.0, excluding0.0and including1.0.

Parameters generator - Generator to use. output_data - Pointer to memory that stores generated numbers. n - Number of doubles to generate.

Return values MURAND_STATUS_SUCCESS If random numbers were successfully generated. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_LAUNCH_FAILURE If a MUSA kernel launch failed. MURAND_STATUS_LENGTH_NOT_MULTIPLE Ifnis not a multiple of the dimension of the used quasi-random generator.

3.1.3.15 murandGetDirectionVectors32()

murandStatus_t MURANDAPI murandGetDirectionVectors32 ( murandDirectionVectors32_t∗vectors[], murandDirectionVectorSet_tset )

Gets the direction vector used to generate a 32-bit quasi-random number.

Gets a pointer to an array of direction vectors that can be used to generate quasirandom number. The resulting pointer will reference an array of direction vectors in host memory.

The array contains vectors with multiple dimensions. Each dimension has 32 vectors. Each vector is an unsigned int.

Supported values ofsetas follows:

  • MURAND_DIRECTION_VECTORS_32_JOEKUO6 (20,000 dimensions).
  • MURAND_SCRAMBLED_DIRECTION_VECTORS_32_JOEKUO6 (20,000 dimensions).

Parameters vectors - Address of pointer in which to return direction vectors. set - Set of direction vectors to use.

Return values MURAND_STATUS_SUCCESS If the pointer was set successfully. MURAND_STATUS_OUT_OF_RANGE If the choice of set is invalid.

3.1.3.16 murandGetDirectionVectors64()

murandStatus_t MURANDAPI murandGetDirectionVectors64 ( murandDirectionVectors64_t∗vectors[], murandDirectionVectorSet_tset )

Gets direction vectors for 64-bit quasirandom number generation.

Gets a pointer to an array of direction vectors that can be used to generate quasirandom number. The resulting pointer will reference an array of direction vectors in host memory.

The array contains vectors with multiple dimensions. Each dimension has 64 vectors. Each individual vector is an unsigned long long.

Supported values ofsetas follows:

  • MURAND_DIRECTION_VECTORS_64_JOEKUO6 (20,000 dimensions).
  • MURAND_SCRAMBLED_DIRECTION_VECTORS_64_JOEKUO6 (20,000 dimensions).

Parameters vectors - Address of pointer in which to return direction vectors. set - Set of direction vectors to use.

Return values MURAND_STATUS_OUT_OF_RANGE If the choice of set is invalid. MURAND_STATUS_SUCCESS If the pointer was set successfully.

3.1.3.17 murandGetScrambleConstants32()

murandStatus_t MURANDAPI murandGetScrambleConstants32 ( unsigned int ∗∗constants)

Gets scramble constants for 32-bit scrambled Sobol'.

Gets a pointer to an array of scramble constants that can be used to generate quasirandom number. The resulting pointer will reference an array of unsinged ints in host memory.

The array contains vectors with multiple dimensions. Each dimension has a single unsigned int constant.

Parameters constants - Address of pointer in which to return scramble constants.

Return values MURAND_STATUS_SUCCESS If the pointer was set successfully.

3.1.3.18 murandGetScrambleConstants64()

murandStatus_t MURANDAPI murandGetScrambleConstants64 ( unsigned long long∗∗constants)

Gets scramble constants for 64-bit scrambled Sobol'.

Gets a pointer to an array of scramble constants that can be used to generate quasirandom number. The resulting pointer will reference an array of unsinged long longs in host memory.

The array contains constants with multiple dimensions. Each dimension has a single unsigned long long constant.

Parameters constants - Address of pointer in which to return scramble constants.

Return values MURAND_STATUS_SUCCESS If the pointer was set successfully.

3.1.3.19 murandGetVersion()

murandStatus_t MURANDAPI murandGetVersion ( int∗version )

Returns the version of the library.

Returns inversionthe version of the dynamically linked muRAND library.

Parameters version - The version of the library.

Return values MURAND_STATUS_OUT_OF_RANGE Ifversionis NULL. MURAND_STATUS_SUCCESS If the version was returned successfully.

3.1.3.20 murandSetGeneratorOffset()

murandStatus_t MURANDAPI murandSetGeneratorOffset ( murandGenerator_tgenerator, unsigned long longoffset) Sets the offset of the random number generator. Sets the absolute offset of the random number generator. This function will reset the internal state of the generator, but will not change the seed of the generator. Note that the absolute offset cannot be set if the type of generator is MURAND_RNG_PSEUDO_MTGP32.

Parameters generator - Random number generator. offset - New absolute offset.

Return values MURAND_STATUS_SUCCESS If offset was set successfully. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_TYPE_ERROR If the generator's type is MURAND_RNG_PSEUDO_MTGP32.

3.1.3.21 murandSetGeneratorOrdering()

murandStatus_t MURANDAPI murandSetGeneratorOrdering ( murandGenerator_tgenerator, murandOrdering_torder)

Sets the order of the random number generator.

Sets the ordering of random number generator results. This function will reset the internal state of the generator, but will not change the seed of the generator.

Parameters generator - Random number generator. order - New ordering of results.

The ordering choices for pseudorandom sequences are MURAND_ORDERING_PSEUDO_DEFAULT and MURAND_ORDERING_PSEUDO_LEGACY. The default ordering is MURAND_ORDERING_PSEUDO_DEFAULT, which is currently equal to MURAND_ORDERING_PSEUDO_LEGACY.

For quasirandom sequences, there is only one ordering MURAND_ORDERING_QUASI_DEFAULT.

Return values MURAND_STATUS_SUCCESS If the ordering was set successfully. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_OUT_OF_RANGE If the ordering is not valid. MURAND_STATUS_TYPE_ERROR If the type of generator is not valid.

3.1.3.22 murandSetPseudoRandomGeneratorSeed()

murandStatus_t MURANDAPI murandSetPseudoRandomGeneratorSeed ( murandGenerator_tgenerator, unsigned long longseed)

Sets the seed of the pseudo-random number generator.

This function will reset the internal state of the generator, but will not change the offset of the generator.

For the MRG32K3a generator, the seed value cannot be zero. Ifseedis equal to zero and the typr of the generator is MURAND_RNG_PSEUDO_MRG32K3A, then 12345 will be used as the seed value.

Parameters generator - Pseudo-random number generator. seed - The value of seed.

Return values MURAND_STATUS_SUCCESS If seed was set successfully. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_TYPE_ERROR If the generator is a quasi-random number generator.

3.1.3.23 murandSetQuasiRandomGeneratorDimensions()

murandStatus_t MURANDAPI murandSetQuasiRandomGeneratorDimensions ( murandGenerator_tgenerator, unsigned int dimensions)

Sets the number of dimensions of a quasi-random number generator.

Sets the number of dimensions of a quasi-random number generator. Supported values ofdimensionsare 1 to 20000.

This function will reset the internal state of the generator, but will not change the offset of the generator.

Parameters generator - Quasi-random number generator. dimensions - Number of dimensions.

Return values MURAND_STATUS_SUCCESS If the number of dimensions was set successfully. MURAND_STATUS_NOT_CREATED If the generator was not created. MURAND_STATUS_TYPE_ERROR If the generator is not a quasi-random number generator. MURAND_STATUS_OUT_OF_RANGE Ifdimensionsis out of range.

3.1.3.24 murandSetStream()

murandStatus_t MURANDAPI murandSetStream ( murandGenerator_tgenerator, MUstreamstream) Sets the current stream for kernel launches. Sets the current stream for all kernel launches of the generator. All functions will use this stream until set again.

Parameters generator - Generator to modify. stream - Stream to use or NULL for default stream.

Return values MURAND_STATUS_SUCCESS If stream was set successfully. MURAND_STATUS_NOT_CREATED If the generator was not created.

3.2 Device API

Macros

  • #define MURAND_MRG32K3A_DEFAULT_SEED 12345ULL Default seed for MRG32K3A PRNG.
  • #define MURAND_PHILOX4x32_DEFAULT_SEED 0xdeadbeefdeadbeefULL Default seed for PHILOX4x32 PRNG.
  • #define FQUALIFIERS forceinline device
  • #define MURAND_XORWOW_DEFAULT_SEED 0ULL Default seed for XORWOW PRNG.

Functions

  • FQUALIFIERS float murand_log_normal (murandStatePhilox4_32_10_t∗state, float mean, float stddev) Returns a log-normally distributedfloatvalue.
  • FQUALIFIERS double murand_log_normal_double (murandStatePhilox4_32_10_t∗state, double mean, dou- ble stddev) Returns a log-normally distributeddoublevalues.
  • FQUALIFIERS float murand_log_normal (murandStateMRG32k3a_t∗state, float mean, float stddev) Returns a log-normally distributedfloatvalue.
  • FQUALIFIERS double murand_log_normal_double (murandStateMRG32k3a_t∗state, double mean, double stddev) Returns a log-normally distributeddoublevalue.
  • FQUALIFIERS float murand_log_normal (murandStateXORWOW_t∗state, float mean, float stddev) Returns a log-normally distributedfloatvalue.
  • FQUALIFIERS double murand_log_normal_double (murandStateXORWOW_t∗state, double mean, double stddev) Returns a log-normally distributeddoublevalue.
  • FQUALIFIERS float murand_log_normal (murandStateMtgp32_t∗state, float mean, float stddev) Returns a log-normally distributedfloatvalue.
  • FQUALIFIERS double murand_log_normal_double (murandStateMtgp32_t∗state, double mean, double std- dev) Returns a log-normally distributeddoublevalue.
  • FQUALIFIERS float murand_log_normal (murandStateSobol32_t∗state, float mean, float stddev) Returns a log-normally distributedfloatvalue.
  • FQUALIFIERS double murand_log_normal_double (murandStateSobol32_t∗state, double mean, double std- dev)
Returns a log-normally distributeddoublevalue.
  • FQUALIFIERS float murand_log_normal (murandStateScrambledSobol32_t∗state, float mean, float stddev) Returns a log-normally distributedfloatvalue.
  • FQUALIFIERS double murand_log_normal_double (murandStateScrambledSobol32_t∗state, double mean, double stddev) Returns a log-normally distributeddoublevalue.
  • FQUALIFIERS float murand_log_normal (murandStateSobol64_t∗state, float mean, float stddev) Returns a log-normally distributedfloatvalue.
  • FQUALIFIERS double murand_log_normal_double (murandStateSobol64_t∗state, double mean, double std- dev) Returns a log-normally distributeddoublevalue.
  • FQUALIFIERS float murand_log_normal (murandStateScrambledSobol64_t∗state, float mean, float stddev) Returns a log-normally distributedfloatvalue.
  • FQUALIFIERS double murand_log_normal_double (murandStateScrambledSobol64_t∗state, double mean, double stddev) Returns a log-normally distributeddoublevalue.
  • FQUALIFIERS void murand_init (const unsigned long long seed, const unsigned long long subsequence, const unsigned long long offset, murandStateMRG32k3a_t∗state) Initializes MRG32K3A state.
  • FQUALIFIERS unsigned int murand (murandStateMRG32k3a_t∗state) Returns uniformly distributed randomunsigned intvalue.
  • host murandStatus_t murandMakeMTGP32KernelState (murandStateMtgp32_t∗d_state, mtgp32_params_fast_t params[ ], int n, unsigned long long seed) Initializes MTGP32 states.
  • FQUALIFIERS unsigned int murand (murandStateMtgp32_t∗state) Returns uniformly distributed randomunsigned intvalue.
  • FQUALIFIERS float murand_normal (murandStatePhilox4_32_10_t∗state) Returns a normally distributedfloatvalue.
  • FQUALIFIERS float4 murand_normal4 (murandStatePhilox4_32_10_t∗state) Returns four normally distributedfloatvalues.
  • FQUALIFIERS double murand_normal_double (murandStatePhilox4_32_10_t∗state) Returns a normally distributeddoublevalue.
  • FQUALIFIERS double2 murand_normal2_double (murandStatePhilox4_32_10_t∗state) Returns two normally distributeddoublevalues.
  • FQUALIFIERS float murand_normal (murandStateMRG32k3a_t∗state) Returns a normally distributedfloatvalue.
  • FQUALIFIERS double murand_normal_double (murandStateMRG32k3a_t∗state) Returns a normally distributeddoublevalue.
  • FQUALIFIERS double2 murand_normal2_double (murandStateMRG32k3a_t∗state) Returns two normally distributeddoublevalues.
  • FQUALIFIERS float murand_normal (murandStateXORWOW_t∗state) Returns a normally distributedfloatvalue.
  • FQUALIFIERS double murand_normal_double (murandStateXORWOW_t∗state) Returns a normally distributeddoublevalue.
  • FQUALIFIERS double2 murand_normal2_double (murandStateXORWOW_t∗state) Returns two normally distributeddoublevalues.
  • FQUALIFIERS float murand_normal (murandStateMtgp32_t∗state) Returns a normally distributedfloatvalue.
  • FQUALIFIERS double murand_normal_double (murandStateMtgp32_t∗state) Returns a normally distributeddoublevalue.
  • FQUALIFIERS float murand_normal (murandStateSobol32_t∗state)
Returns a normally distributedfloatvalue.
  • FQUALIFIERS double murand_normal_double (murandStateSobol32_t∗state) Returns a normally distributeddoublevalue.
  • FQUALIFIERS float murand_normal (murandStateScrambledSobol32_t∗state) Returns a normally distributedfloatvalue.
  • FQUALIFIERS double murand_normal_double (murandStateScrambledSobol32_t∗state) Returns a normally distributeddoublevalue.
  • FQUALIFIERS float murand_normal (murandStateSobol64_t∗state) Returns a normally distributedfloatvalue.
  • FQUALIFIERS double murand_normal_double (murandStateSobol64_t∗state) Returns a normally distributeddoublevalue.
  • FQUALIFIERS float murand_normal (murandStateScrambledSobol64_t∗state) Returns a normally distributedfloatvalue.
  • FQUALIFIERS double murand_normal_double (murandStateScrambledSobol64_t∗state) Returns a normally distributeddoublevalue.
  • FQUALIFIERS void murand_init (const unsigned long long seed, const unsigned long long subsequence, const unsigned long long offset, murandStatePhilox4_32_10_t∗state) Initializes Philox state.
  • FQUALIFIERS unsigned int murand (murandStatePhilox4_32_10_t∗state) Returns uniformly distributed randomunsigned intvalue.
  • FQUALIFIERS uint4 murand4 (murandStatePhilox4_32_10_t∗state) Returns four uniformly distributed randomunsigned intvalues.
  • FQUALIFIERS unsigned int murand_poisson (murandStatePhilox4_32_10_t∗state, double lambda) Returns a Poisson-distributedunsigned intusing the Philox generator.
  • FQUALIFIERS unsigned int murand_poisson (murandStateMRG32k3a_t∗state, double lambda) Returns a Poisson-distributedunsigned intusing the MRG32k3a generator.
  • FQUALIFIERS unsigned int murand_poisson (murandStateXORWOW_t∗state, double lambda) Returns a Poisson-distributedunsigned intusing the XORWOW generator.
  • FQUALIFIERS unsigned int murand_poisson (murandStateMtgp32_t∗state, double lambda) Returns a Poisson-distributedunsigned intusing the MTGP32 generator.
  • FQUALIFIERS unsigned int murand_poisson (murandStateSobol32_t∗state, double lambda) Returns a Poisson-distributedunsigned intusing the SOBOL32 generator.
  • FQUALIFIERS unsigned int murand_poisson (murandStateScrambledSobol32_t∗state, double lambda) Returns a Poisson-distributedunsigned intusing the SCRAMBLED_SOBOL32 generator.
  • FQUALIFIERS unsigned long long int murand_poisson (murandStateSobol64_t∗state, double lambda) Returns a Poisson-distributedunsigned long long intusing the SOBOL64 generator.
  • FQUALIFIERS unsigned long long int murand_poisson (murandStateScrambledSobol64_t∗state, double lambda) Returns a Poisson-distributedunsigned long long intusing the SCRAMBLED_SOBOL64 generator.
  • FQUALIFIERS void murand_init (const unsigned int∗vectors, const unsigned int scramble_constant, const unsigned int offset, murandStateScrambledSobol32_t∗state) Initializes scrambled_sobol32 state.
  • FQUALIFIERS unsigned int murand (murandStateScrambledSobol32_t∗state) Returns uniformly distributed randomunsigned intvalue.
  • FQUALIFIERS void murand_init (const unsigned long long int∗vectors, const unsigned long long int scramble_constant, const unsigned int offset, murandStateScrambledSobol64_t∗state) Initializes scrambled_sobol64 state.
  • FQUALIFIERS unsigned long long int murand (murandStateScrambledSobol64_t∗state) Returns uniformly distributed randomunsigned intvalue.
  • FQUALIFIERS void murand_init (const unsigned int∗vectors, const unsigned int offset, murandState←- Sobol32_t∗state)
Initializes SOBOL32 state.
  • FQUALIFIERS unsigned int murand (murandStateSobol32_t∗state) Returns uniformly distributed randomunsigned intvalue.
  • FQUALIFIERS void murand_init (const unsigned long long int∗vectors, const unsigned int offset, murand←- StateSobol64_t∗state) Initializes sobol64 state.
  • FQUALIFIERS unsigned long long int murand (murandStateSobol64_t∗state) Returns uniformly distributed randomunsigned intvalue.
  • FQUALIFIERS float murand_uniform (murandStatePhilox4_32_10_t∗state) Returns a uniformly distributed randomfloatvalue.
  • FQUALIFIERS float4 murand_uniform4 (murandStatePhilox4_32_10_t∗state) Returns four uniformly distributed randomfloatvalues.
  • FQUALIFIERS double murand_uniform_double (murandStatePhilox4_32_10_t∗state) Returns a uniformly distributed randomdoublevalue.
  • FQUALIFIERS double2 murand_uniform2_double (murandStatePhilox4_32_10_t∗state) Returns two uniformly distributed randomdoublevalues.
  • FQUALIFIERS float murand_uniform (murandStateMRG32k3a_t∗state) Returns a uniformly distributed randomfloatvalue.
  • FQUALIFIERS double murand_uniform_double (murandStateMRG32k3a_t∗state) Returns a uniformly distributed randomdoublevalue.
  • FQUALIFIERS float murand_uniform (murandStateXORWOW_t∗state) Returns a uniformly distributed randomfloatvalue.
  • FQUALIFIERS double murand_uniform_double (murandStateXORWOW_t∗state) Returns a uniformly distributed randomdoublevalue.
  • FQUALIFIERS float murand_uniform (murandStateMtgp32_t∗state) Returns a uniformly distributed randomfloatvalue.
  • FQUALIFIERS double murand_uniform_double (murandStateMtgp32_t∗state) Returns a uniformly distributed randomdoublevalue.
  • FQUALIFIERS float murand_uniform (murandStateSobol32_t∗state) Returns a uniformly distributed randomfloatvalue.
  • FQUALIFIERS double murand_uniform_double (murandStateSobol32_t∗state) Returns a uniformly distributed randomdoublevalue.
  • FQUALIFIERS float murand_uniform (murandStateScrambledSobol32_t∗state) Returns a uniformly distributed randomfloatvalue.
  • FQUALIFIERS double murand_uniform_double (murandStateScrambledSobol32_t∗state) Returns a uniformly distributed randomdoublevalue.
  • FQUALIFIERS float murand_uniform (murandStateSobol64_t∗state) Returns a uniformly distributed randomfloatvalue.
  • FQUALIFIERS double murand_uniform_double (murandStateSobol64_t∗state) Returns a uniformly distributed randomdoublevalue.
  • FQUALIFIERS float murand_uniform (murandStateScrambledSobol64_t∗state) Returns a uniformly distributed randomfloatvalue.
  • FQUALIFIERS double murand_uniform_double (murandStateScrambledSobol64_t∗state) Returns a uniformly distributed randomdoublevalue.
  • FQUALIFIERS void murand_init (const unsigned long long seed, const unsigned long long subsequence, const unsigned long long offset, murandStateXORWOW_t∗state) Initializes XORWOW state.
  • FQUALIFIERS unsigned int murand (murandStateXORWOW_t∗state) Returns uniformly distributed randomunsigned intvalue.

3.2.1 Detailed Description

This section describes muRAND device API.

3.2.2 Function Documentation

3.2.2.1 murand()[1/8].

FQUALIFIERS unsigned int murand ( murandStateMRG32k3a_t ∗state)

Returns uniformly distributed randomunsigned intvalue.

Generates and returns uniformly distributed randomunsigned intvalue from [0; 2∧32 - 1] range using MRG32K3A generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use.

Returns Pseudorandom value (32-bit) as anunsigned int.

3.2.2.2 murand()[2/8].

FQUALIFIERS unsigned int murand ( murandStateMtgp32_t∗state)

Returns uniformly distributed randomunsigned intvalue.

Generates and returns uniformly distributed randomunsigned intvalue from [0; 2∧32 - 1] range using MTGP32 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use.

Returns Pseudorandom value (32-bit) as anunsigned int.

3.2.2.3 murand()[3/8].

FQUALIFIERS unsigned int murand ( murandStatePhilox4_32_10_t∗state)

Returns uniformly distributed randomunsigned intvalue.

Generates and returns uniformly distributed randomunsigned intvalue from [0; 2∧32 - 1] range using Philox generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use.

Returns Pseudorandom value (32-bit) as anunsigned int.

3.2.2.4 murand()[4/8].

FQUALIFIERS unsigned int murand ( murandStateScrambledSobol32_t∗state)

Returns uniformly distributed randomunsigned intvalue.

Generates and returns uniformly distributed randomunsigned intvalue from [0; 2∧32 - 1] range using scrambled_sobol32 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use.

Returns Quasirandom value (32-bit) as anunsigned int.

3.2.2.5 murand()[5/8].

FQUALIFIERS unsigned long long int murand ( murandStateScrambledSobol64_t∗state)

Returns uniformly distributed randomunsigned intvalue.

Generates and returns uniformly distributed randomunsigned intvalue from [0; 2∧64 - 1] range using scrambled_sobol64 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use.

Returns Quasirandom value (64-bit) as anunsigned int.

3.2.2.6 murand()[6/8].

FQUALIFIERS unsigned int murand ( murandStateSobol32_t∗state)

Returns uniformly distributed randomunsigned intvalue.

Generates and returns uniformly distributed randomunsigned intvalue from [0; 2∧32 - 1] range using Sobol32 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use.

Returns Quasirandom value (32-bit) as anunsigned int.

3.2.2.7 murand()[7/8].

FQUALIFIERS unsigned long long int murand ( murandStateSobol64_t∗state)

Returns uniformly distributed randomunsigned intvalue.

Generates and returns uniformly distributed randomunsigned intvalue from [0; 2∧64 - 1] range using sobol64 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use.

Returns Quasirandom value (64-bit) as anunsigned int.

3.2.2.8 murand()[8/8].

FQUALIFIERS unsigned int murand ( murandStateXORWOW_t∗state)

Returns uniformly distributed randomunsigned intvalue.

Generates and returns uniformly distributed randomunsigned intvalue from [0; 2∧32 - 1] range using XOR- WOW generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use.

Returns Pseudorandom value (32-bit) as anunsigned int.

3.2.2.9 murand4()

FQUALIFIERS uint4 murand4 ( murandStatePhilox4_32_10_t∗state)

Returns four uniformly distributed randomunsigned intvalues.

Generates and returns four uniformly distributed randomunsigned intvalues from [0; 2∧32 - 1] range using Philox generator instate. The state is incremented by four positions.

Parameters state - Pointer to a state to use.

Returns Four pseudorandom values (32-bit) as anuint4.

3.2.2.10 murand_init()[1/7].

FQUALIFIERS void murand_init ( const unsigned int∗vectors, const unsigned intoffset, murandStateSobol32_t∗state)

Initializes SOBOL32 state.

Initializes the SOBOL32 generatorstatewith the given directionvectorsandoffset.

Parameters vectors - Direction vectors. offset - Absolute offset into sequence. state - Pointer to state to initialize.

3.2.2.11 murand_init()[2/7].

FQUALIFIERS void murand_init ( const unsigned int∗vectors,

const unsigned intscramble_constant,
const unsigned intoffset,
murandStateScrambledSobol32_t∗state)

Initializes scrambled_sobol32 state.

Initializes the scrambled_sobol32 generatorstatewith the given directionvectorsandoffset.

Parameters vectors - Direction vectors. scramble_constant - The constant is used to scramble the sequence. offset - Absolute offset into sequence. state - Pointer to state to initialize.

3.2.2.12 murand_init()[3/7].

FQUALIFIERS void murand_init ( const unsigned long long int∗vectors, const unsigned intoffset, murandStateSobol64_t∗state)

Initializes sobol64 state.

Initializes the sobol64 generatorstatewith the given directionvectorsandoffset.

Parameters vectors - Direction vectors. offset - Absolute offset into sequence. state - Pointer to state to initialize.

3.2.2.13 murand_init()[4/7].

FQUALIFIERS void murand_init ( const unsigned long long int∗vectors, const unsigned long long intscramble_constant, const unsigned intoffset, murandStateScrambledSobol64_t∗state)

Initializes scrambled_sobol64 state.

Initializes the scrambled_sobol64 generatorstatewith the given directionvectorsandoffset.

Parameters vectors - Direction vectors. scramble_constant - The constant is used to scramble the sequence. offset - Absolute offset into sequence. state - Pointer to state to initialize.

3.2.2.14 murand_init()[5/7].

FQUALIFIERS void murand_init ( const unsigned long longseed, const unsigned long longsubsequence, const unsigned long longoffset, murandStateMRG32k3a_t ∗state)

Initializes MRG32K3A state.

Initializes the MRG32K3A generatorstatewith the givenseed,subsequence, andoffset.

Parameters seed - Value for use as a seed. subsequence - Subsequence to start at. offset - Absolute offset into subsequence. state - Pointer to state to initialize.

3.2.2.15 murand_init()[6/7].

FQUALIFIERS void murand_init ( const unsigned long longseed, const unsigned long longsubsequence, const unsigned long longoffset, murandStatePhilox4_32_10_t∗state)

Initializes Philox state.

Initializes the Philox generatorstatewith the givenseed,subsequence, andoffset.

Parameters seed - Value for use as a seed. subsequence - Subsequence to start at. offset - Absolute offset into subsequence. state - Pointer to state to initialize.

3.2.2.16 murand_init()[7/7].

FQUALIFIERS void murand_init ( const unsigned long longseed, const unsigned long longsubsequence, const unsigned long longoffset, murandStateXORWOW_t∗state)

Initializes XORWOW state.

Initializes the XORWOW generatorstatewith the givenseed,subsequence, andoffset.

Parameters seed - Value for use as a seed. subsequence - Subsequence to start at. offset - Absolute offset into subsequence. state - Pointer to state to initialize.

3.2.2.17 murand_log_normal()[1/8]

FQUALIFIERS float murand_log_normal ( murandStateMRG32k3a_t ∗state, floatmean, floatstddev)

Returns a log-normally distributedfloatvalue.

Generates and returns a log-normally distributedfloatvalue using MRG32k3a generator instate, and incre- ments position of the generator by one. This function generates two normally distributed values using the Box-Muller transform method, transforms them to log-normally distributed values, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributedfloatvalue.

3.2.2.18 murand_log_normal()[2/8]

FQUALIFIERS float murand_log_normal ( murandStateMtgp32_t∗state, floatmean, floatstddev)

Returns a log-normally distributedfloatvalue.

Generates and returns a log-normally distributedfloatvalue using MTGP32 generator instate, and increments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributedfloatvalue.

3.2.2.19 murand_log_normal()[3/8]

FQUALIFIERS float murand_log_normal ( murandStatePhilox4_32_10_t∗state, floatmean, floatstddev)

Returns a log-normally distributedfloatvalue.

Generates and returns a log-normally distributedfloatvalue using Philox generator instate, and increments position of the generator by one. This function generates two normally distributed values using the Box-Muller transform method, transforms them to log-normally distributed values, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributedfloatvalue.

3.2.2.20 murand_log_normal()[4/8]

FQUALIFIERS float murand_log_normal ( murandStateScrambledSobol32_t∗state, floatmean, floatstddev)

Returns a log-normally distributedfloatvalue.

Generates and returns a log-normally distributedfloatvalue using SCRAMBLED_SOBOL32 generator in state, and increments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributedfloatvalue.

3.2.2.21 murand_log_normal()[5/8]

FQUALIFIERS float murand_log_normal ( murandStateScrambledSobol64_t∗state, floatmean, floatstddev)

Returns a log-normally distributedfloatvalue.

Generates and returns a log-normally distributedfloatvalue using SCRAMBLED_SOBOL64 generator in state, and increments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributedfloatvalue.

3.2.2.22 murand_log_normal()[6/8]

FQUALIFIERS float murand_log_normal ( murandStateSobol32_t∗state, floatmean, floatstddev)

Returns a log-normally distributedfloatvalue.

Generates and returns a log-normally distributedfloatvalue using SOBOL32 generator instate, and incre- ments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributedfloatvalue.

3.2.2.23 murand_log_normal()[7/8]

FQUALIFIERS float murand_log_normal ( murandStateSobol64_t∗state,

floatmean,
floatstddev)

Returns a log-normally distributedfloatvalue.

Generates and returns a log-normally distributedfloatvalue using SOBOL64 generator instate, and incre- ments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributedfloatvalue.

3.2.2.24 murand_log_normal()[8/8]

FQUALIFIERS float murand_log_normal ( murandStateXORWOW_t∗state, floatmean, floatstddev)

Returns a log-normally distributedfloatvalue.

Generates and returns a log-normally distributedfloatvalue using XORWOW generator instate, and incre- ments position of the generator by one. This function generates two normally distributed values using the Box-Muller transform, transforms them to log-normally distributed values, returns the first one, and saves the second to be re- turned on the subsequent call.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributedfloatvalue.

3.2.2.25 murand_log_normal_double()[1/8]

FQUALIFIERS double murand_log_normal_double ( murandStateMRG32k3a_t ∗state, doublemean, doublestddev)

Returns a log-normally distributeddoublevalue.

Generates and returns a log-normally distributeddoublevalue using MRG32k3a generator instate, and in- crements position of the generator by one. This function generates two normally distributeddoublevalues using the Box-Muller transform method, transforms them to log-normally distributeddoublevalues, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributeddoublevalue.

3.2.2.26 murand_log_normal_double()[2/8]

FQUALIFIERS double murand_log_normal_double ( murandStateMtgp32_t∗state, doublemean, doublestddev)

Returns a log-normally distributeddoublevalue.

Generates and returns a log-normally distributeddoublevalue using MTGP32 generator instate, and incre- ments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributeddoublevalue.

3.2.2.27 murand_log_normal_double()[3/8]

FQUALIFIERS double murand_log_normal_double ( murandStatePhilox4_32_10_t∗state, doublemean, doublestddev)

Returns a log-normally distributeddoublevalues.

Generates and returns a log-normally distributeddoublevalue using Philox generator instate, and increments position of the generator by two. This function generates two normally distributeddoublevalues using the Box-←- Muller transform method, transforms them to log-normally distributeddoublevalues, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributeddoublevalue.

3.2.2.28 murand_log_normal_double()[4/8]

FQUALIFIERS double murand_log_normal_double ( murandStateScrambledSobol32_t∗state, doublemean, doublestddev)

Returns a log-normally distributeddoublevalue.

Generates and returns a log-normally distributeddoublevalue using SCRAMBLED_SOBOL32 generator in state, and increments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributeddoublevalue.

3.2.2.29 murand_log_normal_double()[5/8]

FQUALIFIERS double murand_log_normal_double ( murandStateScrambledSobol64_t∗state, doublemean, doublestddev)

Returns a log-normally distributeddoublevalue.

Generates and returns a log-normally distributeddoublevalue using SCRAMBLED_SOBOL64 generator in state, and increments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributeddoublevalue.

3.2.2.30 murand_log_normal_double()[6/8]

FQUALIFIERS double murand_log_normal_double ( murandStateSobol32_t∗state, doublemean, doublestddev)

Returns a log-normally distributeddoublevalue.

Generates and returns a log-normally distributeddoublevalue using SOBOL32 generator instate, and incre- ments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributeddoublevalue.

3.2.2.31 murand_log_normal_double()[7/8]

FQUALIFIERS double murand_log_normal_double ( murandStateSobol64_t∗state, doublemean, doublestddev)

Returns a log-normally distributeddoublevalue.

Generates and returns a log-normally distributeddoublevalue using SOBOL64 generator instate, and incre- ments the position of the generator by one.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributeddoublevalue.

3.2.2.32 murand_log_normal_double()[8/8]

FQUALIFIERS double murand_log_normal_double ( murandStateXORWOW_t∗state, doublemean, doublestddev)

Returns a log-normally distributeddoublevalue.

Generates and returns a log-normally distributeddoublevalue using XORWOW generator instate, and incre- ments the position of the generator by two. This function generates two normally distributeddoublevalues using the Box-Muller transform method, transforms them to log-normally distributeddoublevalues, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use. mean - Mean of the related log-normal distribution. stddev - The standard deviation of the related log-normal distribution.

Returns Log-normally distributeddoublevalue.

3.2.2.33 murand_normal()[1/8].

FQUALIFIERS float murand_normal ( murandStateMRG32k3a_t ∗state)

Returns a normally distributedfloatvalue.

Generates and returns a normally distributedfloatvalue using MRG32k3a generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use.

Returns Normally distributedfloatvalue.

3.2.2.34 murand_normal()[2/8].

FQUALIFIERS float murand_normal ( murandStateMtgp32_t∗state)

Returns a normally distributedfloatvalue.

Generates and returns a normally distributedfloatvalue using MTGP32 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributedfloatvalue.

3.2.2.35 murand_normal()[3/8].

FQUALIFIERS float murand_normal ( murandStatePhilox4_32_10_t∗state)

Returns a normally distributedfloatvalue.

Generates and returns a normally distributedfloatvalue using Philox generator instate, and increments position of the generator by one. The normal distribution used has a mean mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use.

Returns Normally distributedfloatvalue.

3.2.2.36 murand_normal()[4/8].

FQUALIFIERS float murand_normal ( murandStateScrambledSobol32_t∗state)

Returns a normally distributedfloatvalue.

Generates and returns a normally distributedfloatvalue using SCRAMBLED_SOBOL32 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributedfloatvalue.

3.2.2.37 murand_normal()[5/8].

FQUALIFIERS float murand_normal ( murandStateScrambledSobol64_t∗state)

Returns a normally distributedfloatvalue.

Generates and returns a normally distributedfloatvalue using SCRAMBLED_SOBOL64 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributedfloatvalue.

3.2.2.38 murand_normal()[6/8].

FQUALIFIERS float murand_normal ( murandStateSobol32_t∗state)

Returns a normally distributedfloatvalue.

Generates and returns a normally distributedfloatvalue using SOBOL32 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributedfloatvalue.

3.2.2.39 murand_normal()[7/8].

FQUALIFIERS float murand_normal ( murandStateSobol64_t∗state)

Returns a normally distributedfloatvalue.

Generates and returns a normally distributedfloatvalue using SOBOL64 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributedfloatvalue.

3.2.2.40 murand_normal()[8/8].

FQUALIFIERS float murand_normal ( murandStateXORWOW_t∗state)

Returns a normally distributedfloatvalue.

Generates and returns a normally distributedfloatvalue using XORWOW generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use.

Returns Normally distributedfloatvalue.

3.2.2.41 murand_normal2_double()[1/3].

FQUALIFIERS double2 murand_normal2_double ( murandStateMRG32k3a_t ∗state)

Returns two normally distributeddoublevalues.

Generates and returns two normally distributeddoublevalues using MRG32k3a generator instate, and in- crements position of the generator by two. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, and returns both of them.

Parameters state - Pointer to a state to use.

Returns Two normally distributeddoublevalue asdouble2.

3.2.2.42 murand_normal2_double()[2/3].

FQUALIFIERS double2 murand_normal2_double ( murandStatePhilox4_32_10_t∗state)

Returns two normally distributeddoublevalues.

Generates and returns two normally distributeddoublevalues using Philox generator instate, and increments position of the generator by four. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, and returns both of them.

Parameters state - Pointer to a state to use.

Returns Two normally distributeddoublevalues asdouble2.

3.2.2.43 murand_normal2_double()[3/3].

FQUALIFIERS double2 murand_normal2_double ( murandStateXORWOW_t∗state)

Returns two normally distributeddoublevalues.

Generates and returns two normally distributeddoublevalues using XORWOW generator instate, and in- crements position of the generator by four. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, and returns both of them.

Parameters state - Pointer to a state to use.

Returns Two normally distributeddoublevalue asdouble2.

3.2.2.44 murand_normal4()

FQUALIFIERS float4 murand_normal4 ( murandStatePhilox4_32_10_t∗state)

Returns four normally distributedfloatvalues.

Generates and returns four normally distributedfloatvalues using Philox generator instate, and increments position of the generator by four. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates four normally distributed values using the Box-Muller transform method, and returns them.

Parameters state - Pointer to a state to use.

Returns Four normally distributedfloatvalue asfloat4.

3.2.2.45 murand_normal_double()[1/8]

FQUALIFIERS double murand_normal_double ( murandStateMRG32k3a_t ∗state)

Returns a normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using MRG32k3a generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

3.2.2.46 murand_normal_double()[2/8]

FQUALIFIERS double murand_normal_double ( murandStateMtgp32_t∗state)

Returns a normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using MTGP32 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

3.2.2.47 murand_normal_double()[3/8]

FQUALIFIERS double murand_normal_double ( murandStatePhilox4_32_10_t∗state)

Returns a normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using Philox generator instate, and increments position of the generator by two. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

3.2.2.48 murand_normal_double()[4/8]

FQUALIFIERS double murand_normal_double ( murandStateScrambledSobol32_t∗state)

Returns a normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using SCRAMBLED_SOBOL32 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using SCRAMBLED_SOBOL32 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

3.2.2.49 murand_normal_double()[5/8]

FQUALIFIERS double murand_normal_double ( murandStateScrambledSobol64_t∗state)

Returns a normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using SCRAMBLED_SOBOL64 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

3.2.2.50 murand_normal_double()[6/8]

FQUALIFIERS double murand_normal_double ( murandStateSobol32_t∗state)

Returns a normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using SOBOL32 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

3.2.2.51 murand_normal_double()[7/8]

FQUALIFIERS double murand_normal_double ( murandStateSobol64_t∗state)

Returns a normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using SOBOL64 generator instate, and increments position of the generator by one. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

3.2.2.52 murand_normal_double()[8/8]

FQUALIFIERS double murand_normal_double ( murandStateXORWOW_t∗state)

Returns a normally distributeddoublevalue.

Generates and returns a normally distributeddoublevalue using XORWOW generator instate, and increments position of the generator by two. The normal distribution used has a mean value equal to 0.0f, and a standard deviation equal to 1.0f. This function generates two normally distributed values using the Box-Muller transform method, returns the first one, and saves the second to be returned on the subsequent call.

Parameters state - Pointer to a state to use.

Returns Normally distributeddoublevalue.

3.2.2.53 murand_poisson()[1/8]

FQUALIFIERS unsigned int murand_poisson ( murandStateMRG32k3a_t ∗state, doublelambda)

Returns a Poisson-distributedunsigned intusing the MRG32k3a generator.

Generates and returns Poisson-distributed distributed randomunsigned intvalues using MRG32k3a genera- tor instate. The state is incremented by a variable amount.

Parameters state - Pointer to a state to use. lambda - Lambda parameter of the Poisson distribution.

Returns Poisson-distributedunsigned int.

3.2.2.54 murand_poisson()[2/8]

FQUALIFIERS unsigned int murand_poisson ( murandStateMtgp32_t∗state, doublelambda)

Returns a Poisson-distributedunsigned intusing the MTGP32 generator.

Generates and returns Poisson-distributed distributed randomunsigned intvalues using MTGP32 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use. lambda - Lambda parameter of the Poisson distribution.

Returns Poisson-distributedunsigned int.

3.2.2.55 murand_poisson()[3/8]

FQUALIFIERS unsigned int murand_poisson ( murandStatePhilox4_32_10_t∗state, doublelambda)

Returns a Poisson-distributedunsigned intusing the Philox generator.

Generates and returns Poisson-distributed distributed randomunsigned intvalues using Philox generator in state. The state is incremented by a variable amount.

Parameters state - Pointer to a state to use. lambda - Lambda parameter of the Poisson distribution.

Returns Poisson-distributedunsigned int.

3.2.2.56 murand_poisson()[4/8]

FQUALIFIERS unsigned int murand_poisson ( murandStateScrambledSobol32_t∗state, doublelambda)

Returns a Poisson-distributedunsigned intusing the SCRAMBLED_SOBOL32 generator.

Generates and returns Poisson-distributed distributed randomunsigned intvalues using SCRAMBLED_←- SOBOL32 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use. lambda - Lambda parameter of the Poisson distribution.

Returns Poisson-distributedunsigned int.

3.2.2.57 murand_poisson()[5/8]

FQUALIFIERS unsigned long long int murand_poisson ( murandStateScrambledSobol64_t∗state, doublelambda)

Returns a Poisson-distributedunsigned long long intusing the SCRAMBLED_SOBOL64 generator.

Generates and returns Poisson-distributed distributed randomunsigned long long intvalues using SCRAMBLED_SOBOL64 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use. lambda - Lambda parameter of the Poisson distribution.

Returns Poisson-distributedunsigned long long int.

3.2.2.58 murand_poisson()[6/8]

FQUALIFIERS unsigned int murand_poisson ( murandStateSobol32_t∗state, doublelambda)

Returns a Poisson-distributedunsigned intusing the SOBOL32 generator.

Generates and returns Poisson-distributed distributed randomunsigned intvalues using SOBOL32 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use. lambda - Lambda parameter of the Poisson distribution.

Returns Poisson-distributedunsigned int.

3.2.2.59 murand_poisson()[7/8]

FQUALIFIERS unsigned long long int murand_poisson ( murandStateSobol64_t∗state, doublelambda)

Returns a Poisson-distributedunsigned long long intusing the SOBOL64 generator.

Generates and returns Poisson-distributed distributed randomunsigned long long intvalues using SOBOL64 generator instate. The state is incremented by one position.

Parameters state - Pointer to a state to use. lambda - Lambda parameter of the Poisson distribution.

Returns Poisson-distributedunsigned long long int.

3.2.2.60 murand_poisson()[8/8]

FQUALIFIERS unsigned int murand_poisson ( murandStateXORWOW_t∗state, doublelambda)

Returns a Poisson-distributedunsigned intusing the XORWOW generator.

Generates and returns Poisson-distributed distributed randomunsigned intvalues using XORWOW generator instate. The state is incremented by a variable amount.

Parameters state - Pointer to a state to use. lambda - Lambda parameter of the Poisson distribution.

Returns Poisson-distributedunsigned int.

3.2.2.61 murand_uniform()[1/8]

FQUALIFIERS float murand_uniform ( murandStateMRG32k3a_t ∗state)

Returns a uniformly distributed randomfloatvalue.

Generates and returns a uniformly distributedfloatvalue from (0; 1] range using MRG32K3A generator in state, and increments position of the generator by one. The output range excludes0.0f, includes1.0f.

Parameters state - Pointer to a state to use.

Returns Uniformly distributedfloatvalue from (0; 1] range.

3.2.2.62 murand_uniform()[2/8]

FQUALIFIERS float murand_uniform ( murandStateMtgp32_t∗state)

Returns a uniformly distributed randomfloatvalue.

Generates and returns a uniformly distributedfloatvalue from (0; 1] range using MTGP32 generator instate, and increments position of the generator by one. The output range excludes0.0f, includes1.0f.

Parameters state - Pointer to a state to use.

Returns Uniformly distributedfloatvalue from (0; 1] range.

3.2.2.63 murand_uniform()[3/8]

FQUALIFIERS float murand_uniform ( murandStatePhilox4_32_10_t∗state)

Returns a uniformly distributed randomfloatvalue.

Generates and returns a uniformly distributedfloatvalue from (0; 1] range using Philox generator instate, and increments position of the generator by one. The output range excludes0.0f, includes1.0f.

Parameters state - Pointer to a state to use.

Returns Uniformly distributedfloatvalue from (0; 1] range.

3.2.2.64 murand_uniform()[4/8]

FQUALIFIERS float murand_uniform ( murandStateScrambledSobol32_t∗state)

Returns a uniformly distributed randomfloatvalue.

Generates and returns a uniformly distributedfloatvalue from (0; 1] range using SCRAMBLED_SOBOL32 gen- erator instate, and increments position of the generator by one. The output range excludes0.0f, includes 1.0f.

Parameters state - Pointer to a state to use.

Returns Uniformly distributedfloatvalue from (0; 1] range.

3.2.2.65 murand_uniform()[5/8]

FQUALIFIERS float murand_uniform ( murandStateScrambledSobol64_t∗state)

Returns a uniformly distributed randomfloatvalue.

Generates and returns a uniformly distributedfloatvalue from (0; 1] range using SCRAMBLED_SOBOL64 gen- erator instate, and increments position of the generator by one. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Returns Uniformly distributedfloatvalue from (0; 1] range.

3.2.2.66 murand_uniform()[6/8]

FQUALIFIERS float murand_uniform ( murandStateSobol32_t∗state)

Returns a uniformly distributed randomfloatvalue.

Generates and returns a uniformly distributedfloatvalue from (0; 1] range using SOBOL32 generator instate, and increments position of the generator by one. The output range excludes0.0f, includes1.0f.

Parameters state - Pointer to a state to use.

Returns Uniformly distributedfloatvalue from (0; 1] range.

3.2.2.67 murand_uniform()[7/8]

FQUALIFIERS float murand_uniform ( murandStateSobol64_t∗state)

Returns a uniformly distributed randomfloatvalue.

Generates and returns a uniformly distributedfloatvalue from (0; 1] range using SOBOL64 generator instate, and increments position of the generator by one. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Returns Uniformly distributedfloatvalue from (0; 1] range.

3.2.2.68 murand_uniform()[8/8]

FQUALIFIERS float murand_uniform ( murandStateXORWOW_t∗state)

Returns a uniformly distributed randomfloatvalue.

Generates and returns a uniformly distributedfloatvalue from (0; 1] range using XORWOW generator instate, and increments position of the generator by one. The output range excludes0.0f, includes1.0f.

Parameters state - Pointer to a state to use.

Returns Uniformly distributedfloatvalue from (0; 1] range.

3.2.2.69 murand_uniform2_double()

FQUALIFIERS double2 murand_uniform2_double ( murandStatePhilox4_32_10_t∗state)

Returns two uniformly distributed randomdoublevalues.

Generates and returns two uniformly distributeddoublevalues from (0; 1] range using Philox generator instate, and increments position of the generator by four. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Returns Two uniformly distributeddoublevalues from (0; 1] range asdouble2.

3.2.2.70 murand_uniform4()

FQUALIFIERS float4 murand_uniform4 ( murandStatePhilox4_32_10_t∗state)

Returns four uniformly distributed randomfloatvalues.

Generates and returns four uniformly distributedfloatvalues from (0; 1] range using Philox generator instate, and increments position of the generator by four. The output range excludes0.0f, includes1.0f.

Parameters state - Pointer to a state to use.

Returns Four uniformly distributedfloatvalues from (0; 1] range asfloat4.

3.2.2.71 murand_uniform_double()[1/8]

FQUALIFIERS double murand_uniform_double ( murandStateMRG32k3a_t ∗state)

Returns a uniformly distributed randomdoublevalue.

Generates and returns a uniformly distributeddoublevalue from (0; 1] range using MRG32K3A generator in state, and increments position of the generator by one. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Note In this implementation, thedoublevalue returned is generated from only 32 random bits (oneunsigned intvalue).

Returns Uniformly distributeddoublevalue from (0; 1] range.

3.2.2.72 murand_uniform_double()[2/8]

FQUALIFIERS double murand_uniform_double ( murandStateMtgp32_t∗state)

Returns a uniformly distributed randomdoublevalue.

Generates and returns a uniformly distributeddoublevalue from (0; 1] range using MTGP32 generator instate, and increments position of the generator by one. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Note In this implementation, thedoublevalue returned is generated from only 32 random bits (oneunsigned intvalue).

Returns Uniformly distributeddoublevalue from (0; 1] range.

3.2.2.73 murand_uniform_double()[3/8]

FQUALIFIERS double murand_uniform_double ( murandStatePhilox4_32_10_t∗state)

Returns a uniformly distributed randomdoublevalue.

Generates and returns a uniformly distributeddoublevalue from (0; 1] range using Philox generator instate, and increments position of the generator by two. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Returns Uniformly distributeddoublevalue from (0; 1] range.

3.2.2.74 murand_uniform_double()[4/8]

FQUALIFIERS double murand_uniform_double ( murandStateScrambledSobol32_t∗state)

Returns a uniformly distributed randomdoublevalue.

Generates and returns a uniformly distributeddoublevalue from (0; 1] range using SCRAMBLED_SOBOL32 generator instate, and increments position of the generator by one. The output range excludes0.0, includes 1.0.

Parameters state - Pointer to a state to use.

Note In this implementation, thedoublevalue returned is generated from only 32 random bits (oneunsigned intvalue).

Returns Uniformly distributeddoublevalue from (0; 1] range.

3.2.2.75 murand_uniform_double()[5/8]

FQUALIFIERS double murand_uniform_double ( murandStateScrambledSobol64_t∗state)

Returns a uniformly distributed randomdoublevalue.

Generates and returns a uniformly distributeddoublevalue from (0; 1] range using SCRAMBLED_SOBOL64 generator instate, and increments position of the generator by one. The output range excludes0.0, includes 1.0.

Parameters state - Pointer to a state to use.

Returns Uniformly distributeddoublevalue from (0; 1] range.

3.2.2.76 murand_uniform_double()[6/8]

FQUALIFIERS double murand_uniform_double ( murandStateSobol32_t∗state)

Returns a uniformly distributed randomdoublevalue.

Generates and returns a uniformly distributeddoublevalue from (0; 1] range using SOBOL32 generator in state, and increments position of the generator by one. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Note In this implementation, thedoublevalue returned is generated from only 32 random bits (oneunsigned intvalue).

Returns Uniformly distributeddoublevalue from (0; 1] range.

3.2.2.77 murand_uniform_double()[7/8]

FQUALIFIERS double murand_uniform_double ( murandStateSobol64_t∗state)

Returns a uniformly distributed randomdoublevalue.

Generates and returns a uniformly distributeddoublevalue from (0; 1] range using SOBOL64 generator in state, and increments position of the generator by one. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Returns Uniformly distributeddoublevalue from (0; 1] range.

3.2.2.78 murand_uniform_double()[8/8]

FQUALIFIERS double murand_uniform_double ( murandStateXORWOW_t∗state)

Returns a uniformly distributed randomdoublevalue.

Generates and returns a uniformly distributeddoublevalue from (0; 1] range using MRG32K3A generator in state, and increments position of the generator by two. The output range excludes0.0, includes1.0.

Parameters state - Pointer to a state to use.

Returns Uniformly distributeddoublevalue from (0; 1] range.

3.2.2.79 murandMakeMTGP32KernelState()

host murandStatus_t murandMakeMTGP32KernelState ( murandStateMtgp32_t∗d_state, mtgp32_params_fast_tparams[], intn, unsigned long longseed) [inline]

Initializes MTGP32 states.

Initializes MTGP32 states on the host side by allocating a state array in host memory, initializing that array, and copying the results to device memory.

Parameters d_state - Pointer to the state array in device memory. params - Pointer to an array of type mtgp32_params_fast_t in host memory. n - Number of states to initialize. seed - The value of seed.

Return values MURAND_STATUS_SUCCESS If states are initialized successfully. MURAND_STATUS_ALLOCATION_FAILED If states could not be initialized.