dpnp.random.PCG64DXSM

class dpnp.random.PCG64DXSM(seed=None, *, device=None, sycl_queue=None)[source]

NumPy's PCG64DXSM bit generator on the device.

For full documentation refer to numpy.random.PCG64DXSM.

The permuted congruential generator of numpy.random.PCG64DXSM, a 128-bit LCG with the DXSM output function. It is seeded and has its state as NumPy's, so the two can exchange states.

Parameters:
seed{None, int, array_like[ints], SeedSequence}, optional

The entropy the state is derived from, as by numpy.random.PCG64DXSM. See dpnp.random.BitGenerator.

Default: None.

device{None, string, SyclDevice, SyclQueue, Device}, optional

An array API concept of device where the output array is created. device can be None, a oneAPI filter selector string, an instance of dpctl.SyclDevice corresponding to a non-partitioned SYCL device, an instance of dpctl.SyclQueue, or a dpnp.tensor.Device object returned by dpnp.ndarray.device.

Default: None.

sycl_queue{None, SyclQueue}, optional

A SYCL queue to use for output array allocation and copying. The sycl_queue can be passed as None (the default), which means to get the SYCL queue from device keyword if present or to use a default queue.

Default: None.

Notes

The raw outputs of random_raw(), the floating-point values of dpnp.random.Generator.random() and dpnp.random.Generator.uniform(), and dpnp.random.Generator.bytes() take a fixed number of engine outputs for every value. They are drawn in the order of the stream, and are the same as NumPy's for the same state, where NumPy draws them with the same algorithm.

Every other method draws from a stream per work-item: each work-item of a call producing n values draws as many values as its rejection samplers need from its own stream, the w-th of which starts w * 2**64 steps ahead, and the call advances the state by ceil(n / 8) * 2**64 steps, but keeps the 32-bit half NumPy buffers. The streams of jumped() do not reach these. The values therefore depend on the output size, and are not the same as NumPy's. For a given state, output size and data type, the raw bits and the uniform floats are the same on every device, while the samplers built on transcendental functions agree to a few ULP, or differ where a rejection sampler then takes another candidate.