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. Seedpnp.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 ofdpctl.SyclDevicecorresponding to a non-partitioned SYCL device, an instance ofdpctl.SyclQueue, or adpnp.tensor.Deviceobject returned bydpnp.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 ofdpnp.random.Generator.random()anddpnp.random.Generator.uniform(), anddpnp.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
nvalues draws as many values as its rejection samplers need from its own stream, thew-th of which startsw * 2**64steps ahead, and the call advances the state byceil(n / 8) * 2**64steps, but keeps the 32-bit half NumPy buffers. The streams ofjumped()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.