dpctl.SyclQueue.fill

SyclQueue.fill(dest, value, count, dtype='u1')

Fill dest with count copies of value and wait.

Internally, this dispatches sycl::queue::fill, which sets each of the count elements of dest to value. The number of bytes written is count multiplied by the size of dtype. The default dtype of "u1" (a single byte) makes the default a byte-wise fill, analogous to memset.

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 to dtype: integral dtype values 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 value is 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 dest is not a dpctl.memory._Memory USM allocation.

  • ValueError – If dtype is unrecognized, or value cannot be represented as dtype.

  • OverflowError – If count is negative.

  • RuntimeError – If the fill operation encountered an error.