dpctl.SyclQueue.fill_async¶
- SyclQueue.fill_async(dest, value, count, dEvents=None, dtype='u1')¶
Fill
destwithcountcopies ofvalueasynchronously.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.Note
The returned event does not keep
destalive. Keepdestalive until the event completes, otherwise its USM allocation may be freed mid-operation, causing a use-after-free.- 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.
dEvents (List[dpctl.SyclEvent], optional) – Events that this fill depends on.
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.
- Returns:
Event associated with the fill operation.
- Return type:
- Raises:
TypeError – If
destis not adpctl.memory._MemoryUSM allocation, ordEventsis not a sequence ofdpctl.SyclEvent.ValueError – If
dtypeis unrecognized, orvaluecannot be represented asdtype.OverflowError – If
countis negative.RuntimeError – If the fill operation encountered an error.