dpctl.SyclQueue.fill¶
- SyclQueue.fill(dest, value, count, dtype='u1')¶
Fill
destwithcountcopies ofvalueand wait.Internally, this dispatches
sycl::queue::fill, which sets each of thecountelements ofdesttovalue. The number of bytes written iscountmultiplied by the size ofdtype. The defaultdtypeof"u1"(a single byte) makes the default a byte-wise fill, analogous tomemset.This is a synchronizing variant corresponding to
dpctl.SyclQueue.fill_async().- Parameters:
dest (dpctl.memory._Memory) – Destination USM allocation to fill.
value (int, float, complex) – Value used to fill
dest. It is reinterpreted according todtype: integraldtypevalues expect a Python integer,"f4"and"f8"expect a Python float, and"c8"and"c16"expect a Python complex.count (int) – Number of elements to fill.
dtype (str, optional) – Data type string of the fill elements. Determines the element size and how
valueis interpreted. Defaults to"u1"(one byte per element). Supported types: i1, u1, i2, u2, i4, u4, i8, u8, f4, f8, c8, c16.
- Raises:
TypeError – If
destis not adpctl.memory._MemoryUSM allocation.ValueError – If
dtypeis unrecognized, orvaluecannot be represented asdtype.OverflowError – If
countis negative.RuntimeError – If the fill operation encountered an error.