rocRAND data type support#

Host API#

Generator types#

Table 11 Supported generators on the host#

Generator

rocRAND support

cuRAND support

XORWOW

MRG32K3A

MTGP32

Philox 4x32-10

MT19937

MRG31K3P

LFSR113

ThreeFry 2x32-20

ThreeFry 4x32-20

ThreeFry 2x64-20

ThreeFry 4x64-20

Sobol32

Scrambled Sobol32

Sobol64

Scrambled Sobol64

Only Sobol64, Scrambled Sobol64, ThreeFry 2x64-20 and ThreeFry 4x64-20 support generation of 64 bit unsigned long long int integers, the other generators generate 32 bit unsigned int integers.

Seed types#

All generators can be seeded with unsigned long long, however LFSR113 can additionally be seeded using an uint4.

Output types#

The generators produce pseudo-random numbers chosen from a given distribution. The following distributions and corresponding output types are supported for the host API:

Uniform distribution#

Table 12 Supported types for uniform distributions on the host#

Type

Size of type

rocRAND support

cuRAND support

unsigned char

8 bit

unsigned short

16 bit

unsigned int

32 bit

unsigned long long

64 bit [1]

half

16 bit

float

32 bit

double

64 bit

Uniform distributions of integral types return a number between 0 and 2^(size in bits) - 1, whereas floating-point types return a number between 0.0 and 1.0, excluding 1.0.

Poisson distribution#

Table 13 Supported types for the poisson distribution on the host#

Type

Size of type

rocRAND support

cuRAND support

unsigned int

32 bit

Normal distribution#

Table 14 Supported types for normal distributions on the host#

Type

Size of type

rocRAND support

cuRAND support

half

16 bit

float

32 bit

double

64 bit

Log-normal distributions#

Table 15 Supported types for log-normal distributions on the host#

Type

Size of type

rocRAND support

cuRAND support

half

16 bit

float

32 bit

double

64 bit

Device API#

Generator types#

Table 16 Supported generators on the device#

Generator

rocRAND support

cuRAND support

XORWOW

MRG32K3A

MTGP32

Philox 4x32-10

MT19937

MRG31K3P

LFSR113

ThreeFry 2x32-20

ThreeFry 4x32-20

ThreeFry 2x64-20

ThreeFry 4x64-20

Sobol32

Scrambled Sobol32

Sobol64

Scrambled Sobol64

Seed types#

All generators can be seeded with unsigned long long, however LFSR113 can additionally be seeded using an uint4.

Output types#

The generators produce pseudo-random numbers chosen from a given distribution. The following distributions and corresponding output types are supported for the device API, however not all generators support all types:

Uniform distribution#

Table 17 Supported types for uniform distributions on the device#

Type

rocRAND support

supported rocRAND generators

cuRAND support

unsigned int

all native 32-bit generators

unsigned long long int

all native 64-bit generators

float

all generators

float2

Philox 4x32-10

float4

Philox 4x32-10

double

all generators

double2

Philox 4x32-10

double4

Philox 4x32-10

Normal distribution#

Table 18 Supported types for normal distributions on the device#

Type

rocRAND support

supported rocRAND generators

cuRAND support

float

all generators

float2

Philox 4x32-10, MRG31K3P, MRG32K3A, XORWOW, LFSR113, all ThreeFry generators

float4

Philox 4x32-10

double

all generators

double2

Philox 4x32-10, MRG31K3P, MRG32K3A, XORWOW, LFSR113, all ThreeFry generators

double4

Philox 4x32-10

Log-normal distributions#

Table 19 Supported types for log-normal distributions on the device#

Type

rocRAND support

supported rocRAND generators

cuRAND support

float

all generators

float2

Philox 4x32-10, MRG31K3P, MRG32K3A, XORWOW, LFSR113, all ThreeFry generators

float4

Philox 4x32-10

double

all generators

double2

Philox 4x32-10, MRG31K3P, MRG32K3A, XORWOW, LFSR113, all ThreeFry generators

double4

Philox 4x32-10

Poisson distributions#

Table 20 Supported types for poisson distributions on the device#

Type

rocRAND support

supported rocRAND generators

cuRAND support

unsigned int

Philox 4x32-10, MRG31k3p, MRG32K3A, XORWOW, MTGP32, Sobol32, Scrambled Sobol32, LFSR113, all ThreeFry generators

unsigned long long int

Sobol64, Scrambled sobol64

uint4

Philox 4x32-10

Discrete distributions#

Table 21 Supported types for discrete distributions on the device#

Type

rocRAND support

supported rocRAND generators

cuRAND support

unsigned int

all generators

uint4

Philox 4x32-10

✅ - only Philox - 4x32-10

Footnotes