Class CudaRandNativeMethods
C# Wrapper-Methods for CuRand functions defined in curand.h
Inheritance
Inherited Members
Namespace: ManagedCuda.CudaRand
Assembly: CudaRand.dll
Syntax
public static class CudaRandNativeMethods
Methods
curandCreateGenerator(ref CurandGenerator, GeneratorType)
Creates a new random number generator of type rng_type and returns it in ref generator.
Declaration
public static CurandStatus curandCreateGenerator(ref CurandGenerator generator, GeneratorType rng_type)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| GeneratorType | rng_type |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandCreateGeneratorHost(ref CurandGenerator, GeneratorType)
Creates a new host CPU random number generator of type rng_type and returns it in ref generator.
Declaration
public static CurandStatus curandCreateGeneratorHost(ref CurandGenerator generator, GeneratorType rng_type)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| GeneratorType | rng_type |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandCreatePoissonDistribution(Double, ref DiscreteDistribution)
Construct histogram array for poisson distribution.
Construct histogram array for poisson distribution with lambda lambda.
For lambda greater than 2000 optimization with normal distribution is used.
Declaration
public static CurandStatus curandCreatePoissonDistribution(double lambda, ref DiscreteDistribution discrete_distribution)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | lambda | lambda for poisson distribution |
| DiscreteDistribution | discrete_distribution | pointer to mapped memory to store histogram |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandDestroyDistribution(DiscreteDistribution)
Destroy histogram array for discrete distribution.
Destroy histogram array for discrete distribution created by curandCreatePoissonDistribution.
Declaration
public static CurandStatus curandDestroyDistribution(DiscreteDistribution discrete_distribution)
Parameters
| Type | Name | Description |
|---|---|---|
| DiscreteDistribution | discrete_distribution | pointer to mapped memory where histogram is stored |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandDestroyGenerator(CurandGenerator)
Destroy an existing generator and free all memory associated with its state.
Declaration
public static CurandStatus curandDestroyGenerator(CurandGenerator generator)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerate(CurandGenerator, CUdeviceptr, SizeT)
Use generator to generate num 32-bit results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(CurandGenerator, CUstream), or the null stream if no stream has been set.
Results are 32-bit values with every bit random.
Declaration
public static CurandStatus curandGenerate(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUdeviceptr | outputPtr | |
| SizeT | num |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerate(CurandGenerator, UInt32[], SizeT)
Use generator to generate num 32-bit results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(CurandGenerator, CUstream), or the null stream if no stream has been set.
Results are 32-bit values with every bit random.
Declaration
public static CurandStatus curandGenerate(CurandGenerator generator, uint[] outputPtr, SizeT num)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.UInt32[] | outputPtr | |
| SizeT | num |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateLogNormal(CurandGenerator, CUdeviceptr, SizeT, Single, Single)
Use generator to generate num float results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using ::curandSetStream(), or the null stream if no stream has been set.
Results are 32-bit floating point values with log-normal distribution based on an associated normal distribution with mean mean and standard deviation stddev.
Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality.
The normally distributed results are transformed into log-normal distribution.
There may be slight numerical differences between results generated on the GPU with generators created with ::curandCreateGenerator() and results calculated on the CPU with generators created with ::curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values.
Declaration
public static CurandStatus curandGenerateLogNormal(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, float mean, float stddev)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUdeviceptr | outputPtr | |
| SizeT | n | |
| System.Single | mean | |
| System.Single | stddev |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateLogNormal(CurandGenerator, Single[], SizeT, Single, Single)
Use generator to generate num float results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using ::curandSetStream(), or the null stream if no stream has been set.
Results are 32-bit floating point values with log-normal distribution based on an associated normal distribution with mean mean and standard deviation stddev.
Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality.
The normally distributed results are transformed into log-normal distribution.
There may be slight numerical differences between results generated on the GPU with generators created with ::curandCreateGenerator() and results calculated on the CPU with generators created with ::curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values.
Declaration
public static CurandStatus curandGenerateLogNormal(CurandGenerator generator, float[] outputPtr, SizeT n, float mean, float stddev)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.Single[] | outputPtr | |
| SizeT | n | |
| System.Single | mean | |
| System.Single | stddev |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateLogNormalDouble(CurandGenerator, CUdeviceptr, SizeT, Double, Double)
Use generator to generate num double results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 64-bit floating point values with log-normal distribution based on an associated normal distribution with mean mean and standard deviation stddev.
Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality. The normally distributed results are transformed into log-normal distribution.
There may be slight numerical differences between results generated on the GPU with generators created with ::curandCreateGenerator() and results calculated on the CPU with generators created with ::curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values.
Declaration
public static CurandStatus curandGenerateLogNormalDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, double mean, double stddev)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUdeviceptr | outputPtr | |
| SizeT | n | |
| System.Double | mean | |
| System.Double | stddev |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateLogNormalDouble(CurandGenerator, Double[], SizeT, Double, Double)
Use generator to generate num double results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 64-bit floating point values with log-normal distribution based on an associated normal distribution with mean mean and standard deviation stddev.
Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality. The normally distributed results are transformed into log-normal distribution.
There may be slight numerical differences between results generated on the GPU with generators created with ::curandCreateGenerator() and results calculated on the CPU with generators created with ::curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values.
Declaration
public static CurandStatus curandGenerateLogNormalDouble(CurandGenerator generator, double[] outputPtr, SizeT n, double mean, double stddev)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.Double[] | outputPtr | |
| SizeT | n | |
| System.Double | mean | |
| System.Double | stddev |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateLongLong(CurandGenerator, CUdeviceptr, SizeT)
Use generator to generate num 64-bit results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(CurandGenerator, CUstream), or the null stream if no stream has been set.
Results are 64-bit values with every bit random.
Declaration
public static CurandStatus curandGenerateLongLong(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUdeviceptr | outputPtr | |
| SizeT | num |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateLongLong(CurandGenerator, UInt64[], SizeT)
Use generator to generate num 64-bit results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(CurandGenerator, CUstream), or the null stream if no stream has been set.
Results are 64-bit values with every bit random.
Declaration
public static CurandStatus curandGenerateLongLong(CurandGenerator generator, ulong[] outputPtr, SizeT num)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.UInt64[] | outputPtr | |
| SizeT | num |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateNormal(CurandGenerator, CUdeviceptr, SizeT, Single, Single)
Use generator to generate num float results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 32-bit floating point values with mean mean and standard deviation stddev.
Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality.
There may be slight numerical differences between results generated on the GPU with generators created with curandCreateGenerator() and results calculated on the CPU with generators created with curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values.
Declaration
public static CurandStatus curandGenerateNormal(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, float mean, float stddev)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUdeviceptr | outputPtr | |
| SizeT | n | |
| System.Single | mean | |
| System.Single | stddev |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateNormal(CurandGenerator, Single[], SizeT, Single, Single)
Use generator to generate num float results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 32-bit floating point values with mean mean and standard deviation stddev.
Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality.
There may be slight numerical differences between results generated on the GPU with generators created with curandCreateGenerator() and results calculated on the CPU with generators created with curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values.
Declaration
public static CurandStatus curandGenerateNormal(CurandGenerator generator, float[] outputPtr, SizeT n, float mean, float stddev)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.Single[] | outputPtr | |
| SizeT | n | |
| System.Single | mean | |
| System.Single | stddev |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateNormalDouble(CurandGenerator, CUdeviceptr, SizeT, Double, Double)
Use generator to generate num double results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 64-bit floating point values with mean mean and standard deviation stddev.
Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality.
There may be slight numerical differences between results generated on the GPU with generators created with curandCreateGenerator() and results calculated on the CPU with generators created with curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values.
Declaration
public static CurandStatus curandGenerateNormalDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, double mean, double stddev)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUdeviceptr | outputPtr | |
| SizeT | n | |
| System.Double | mean | |
| System.Double | stddev |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateNormalDouble(CurandGenerator, Double[], SizeT, Double, Double)
Use generator to generate num double results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 64-bit floating point values with mean mean and standard deviation stddev.
Normally distributed results are generated from pseudorandom generators with a Box-Muller transform, and so require num to be even. Quasirandom generators use an inverse cumulative distribution function to preserve dimensionality.
There may be slight numerical differences between results generated on the GPU with generators created with curandCreateGenerator() and results calculated on the CPU with generators created with curandCreateGeneratorHost(). These differences arise because of differences in results for transcendental functions. In addition, future versions of CURAND may use newer versions of the CUDA math library, so different versions of CURAND may give slightly different numerical values.
Declaration
public static CurandStatus curandGenerateNormalDouble(CurandGenerator generator, double[] outputPtr, SizeT n, double mean, double stddev)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.Double[] | outputPtr | |
| SizeT | n | |
| System.Double | mean | |
| System.Double | stddev |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGeneratePoisson(CurandGenerator, CUdeviceptr, SizeT, Double)
Generate Poisson-distributed unsigned ints.
Use generator to generate num unsigned int results into the device memory at
outputPtr. The device memory must have been previously allocated and be
large enough to hold all the results. Launches are done with the stream
set using curandSetStream(), or the null stream if no stream has been set.
Results are 32-bit unsigned int point values with poisson distribution based on
an associated poisson distribution with lambda lambda.
Declaration
public static CurandStatus curandGeneratePoisson(CurandGenerator generator, CUdeviceptr outputPtr, SizeT n, double lambda)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | Generator to use |
| CUdeviceptr | outputPtr | Pointer to device memory to store CUDA-generated results, or Pointer to host memory to store CPU-generated results |
| SizeT | n | Number of unsigned ints to generate |
| System.Double | lambda | lambda for poisson distribution |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGeneratePoisson(CurandGenerator, UInt32[], SizeT, Double)
Generate Poisson-distributed unsigned ints.
Use generator to generate num unsigned int results into the device memory at
outputPtr. The device memory must have been previously allocated and be
large enough to hold all the results. Launches are done with the stream
set using curandSetStream(), or the null stream if no stream has been set.
Results are 32-bit unsigned int point values with poisson distribution based on
an associated poisson distribution with lambda lambda.
Declaration
public static CurandStatus curandGeneratePoisson(CurandGenerator generator, uint[] outputPtr, SizeT n, double lambda)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | Generator to use |
| System.UInt32[] | outputPtr | Pointer to device memory to store CUDA-generated results, or Pointer to host memory to store CPU-generated results |
| SizeT | n | Number of unsigned ints to generate |
| System.Double | lambda | lambda for poisson distribution |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateSeeds(CurandGenerator)
Generate the starting state of the generator. This function is automatically called by generation functions such as ::curandGenerate() and ::curandGenerateUniform(). It can be called manually for performance testing reasons to separate timings for starting state generation and random number generation.
Declaration
public static CurandStatus curandGenerateSeeds(CurandGenerator generator)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateUniform(CurandGenerator, CUdeviceptr, SizeT)
Use generator to generate num float results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 32-bit floating point values between 0.0f and 1.0f, excluding 0.0f and including 1.0f.
Declaration
public static CurandStatus curandGenerateUniform(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUdeviceptr | outputPtr | |
| SizeT | num |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateUniform(CurandGenerator, Single[], SizeT)
Use generator to generate num float results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 32-bit floating point values between 0.0f and 1.0f, excluding 0.0f and including 1.0f.
Declaration
public static CurandStatus curandGenerateUniform(CurandGenerator generator, float[] outputPtr, SizeT num)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.Single[] | outputPtr | |
| SizeT | num |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateUniformDouble(CurandGenerator, CUdeviceptr, SizeT)
Use generator to generate num double results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 64-bit double precision floating point values between 0.0 and 1.0, excluding 0.0 and including 1.0.
Declaration
public static CurandStatus curandGenerateUniformDouble(CurandGenerator generator, CUdeviceptr outputPtr, SizeT num)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUdeviceptr | outputPtr | |
| SizeT | num |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGenerateUniformDouble(CurandGenerator, Double[], SizeT)
Use generator to generate num double results into the device memory at outputPtr. The device memory must have been previously allocated and be large enough to hold all the results. Launches are done with the stream set using curandSetStream(), or the null stream if no stream has been set.
Results are 64-bit double precision floating point values between 0.0 and 1.0, excluding 0.0 and including 1.0.
Declaration
public static CurandStatus curandGenerateUniformDouble(CurandGenerator generator, double[] outputPtr, SizeT num)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.Double[] | outputPtr | |
| SizeT | num |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGetDirectionVectors32(out IntPtr, DirectionVectorSet)
Get a pointer to an array of direction vectors that can be used for quasirandom number generation. The resulting pointer will reference an array of direction vectors in host memory.
The array contains vectors for many dimensions. Each dimension has 32 vectors. Each individual vector is an unsigned int.
Legal values for set are: - JoeKuo6_32 (20,000 dimensions) - ScrambledJoeKuo6_32 (20,000 dimensions)
Declaration
public static CurandStatus curandGetDirectionVectors32(out IntPtr vectors, DirectionVectorSet set)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | vectors | |
| DirectionVectorSet | set |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGetDirectionVectors64(out IntPtr, DirectionVectorSet)
Get a pointer to an array of direction vectors that can be used for quasirandom number generation. The resulting pointer will reference an array of direction vectors in host memory.
The array contains vectors for many dimensions. Each dimension has 64 vectors. Each individual vector is an unsigned long long.
Legal values for set are: - JoeKuo6_64 (20,000 dimensions) - ScrambledJoeKuo6_64 (20,000 dimensions)
Declaration
public static CurandStatus curandGetDirectionVectors64(out IntPtr vectors, DirectionVectorSet set)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | vectors | |
| DirectionVectorSet | set |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGetScrambleConstants32(out IntPtr)
Get a pointer to an array of scramble constants that can be used for quasirandom number generation. The resulting pointer will reference an array of unsinged ints in host memory.
The array contains constants for many dimensions. Each dimension has a single unsigned int constant.
Declaration
public static CurandStatus curandGetScrambleConstants32(out IntPtr constants)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | constants |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGetScrambleConstants64(out IntPtr)
Get a pointer to an array of scramble constants that can be used for quasirandom number generation. The resulting pointer will reference an array of unsinged long longs in host memory.
The array contains constants for many dimensions. Each dimension has a single unsigned long long constant.
Declaration
public static CurandStatus curandGetScrambleConstants64(out IntPtr constants)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | constants |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandGetVersion(ref Int32)
Return in version the version number of the dynamically linked CURAND library. The format is the same as CUDART_VERSION from the CUDA Runtime. The only supported configuration is CURAND version equal to CUDA Runtime version.
Declaration
public static CurandStatus curandGetVersion(ref int version)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | version |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandSetGeneratorOffset(CurandGenerator, UInt64)
Set the absolute offset of the pseudo or quasirandom number generator.
All values of offset are valid. The offset position is absolute, not relative to the current position in the sequence.
Declaration
public static CurandStatus curandSetGeneratorOffset(CurandGenerator generator, ulong offset)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.UInt64 | offset |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandSetGeneratorOrdering(CurandGenerator, Ordering)
Set the ordering of results of the pseudo or quasirandom number generator.
Legal values of order for pseudorandom generators are:
Legal values of order for quasirandom generators are:
Declaration
public static CurandStatus curandSetGeneratorOrdering(CurandGenerator generator, Ordering order)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| Ordering | order |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandSetPseudoRandomGeneratorSeed(CurandGenerator, UInt64)
Set the seed value of the pseudorandom number generator. All values of seed are valid. Different seeds will produce different sequences. Different seeds will often not be statistically correlated with each other, but some pairs of seed values may generate sequences which are statistically correlated.
Declaration
public static CurandStatus curandSetPseudoRandomGeneratorSeed(CurandGenerator generator, ulong seed)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.UInt64 | seed |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandSetQuasiRandomGeneratorDimensions(CurandGenerator, UInt32)
Set the number of dimensions to be generated by the quasirandom number generator.
Legal values for num_dimensions are 1 to 20000.
Declaration
public static CurandStatus curandSetQuasiRandomGeneratorDimensions(CurandGenerator generator, uint num_dimensions)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| System.UInt32 | num_dimensions |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |
curandSetStream(CurandGenerator, CUstream)
Set the current stream for CURAND kernel launches. All library functions will use this stream until set again.
Declaration
public static CurandStatus curandSetStream(CurandGenerator generator, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CurandGenerator | generator | |
| CUstream | stream |
Returns
| Type | Description |
|---|---|
| CurandStatus | Status |