dpctl.SyclQueue.memset

SyclQueue.memset(mem, val, count=0)

Fill USM allocation mem with the byte value val and wait.

Internally, this dispatches sycl::queue::memset. The operation is byte-wise: count bytes are set, each to the same value val.

This is a synchronizing variant corresponding to dpctl.SyclQueue.memset_async().

Parameters:
  • mem – Destination USM allocation, an instance of dpctl.memory._Memory.

  • val (int) – Value to fill mem with. Following sycl::queue::memset, it is interpreted as an unsigned char, i.e. only the least significant byte is used.

  • count (int, optional) – Number of bytes to fill. If 0 or greater than the size of mem, the whole allocation is filled. Default: 0.

Raises:
  • TypeError – If mem is not an instance of dpctl.memory._Memory.

  • OverflowError – If val does not fit in a C int or count is negative.

  • RuntimeError – If the memset operation encountered an error.