dpnp.random.Philox4x3210¶
- class dpnp.random.Philox4x3210(seed=None, *, counter=None, key=None, device=None, sycl_queue=None)[source]¶
A Philox4x32-10 counter-based bit generator on the device.
The generator of Salmon et al. (2011), with a 64-bit key and a 128-bit counter, as implemented by the oneMKL device RNG API (oneMath's in a oneMath build). It is not the same as
numpy.random.Philox, which is Philox4x64-10.- Parameters:
- seed{None, int, array_like[ints], SeedSequence}, optional
The entropy the key is derived from, unless key is given. See
dpnp.random.BitGenerator.Default:
None.- counter{None, int}, optional
The initial 128-bit counter.
Default:
None, which starts from 0.- key{None, int}, optional
The 64-bit key. Mutually exclusive with seed.
Default:
None, which derives the key from seed.- 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
Every call that produces
nvalues takesceil(n / 8)blocks of 2**64 counter values, one for each work-item of the kernel, and every work-item draws as many values as its rejection samplers need from its own block. Elementicomes from the blocki % ceil(n / 8), so the values depend on the output size: a draw is not a prefix of a larger one. 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, such as the normal one, agree to a few ULP.