dpctl.SyclQueue.memset_async¶
- SyclQueue.memset_async(mem, val, count=0, dEvents=None)¶
Fill USM allocation
memwith the byte valuevalasynchronously.Internally, this dispatches
sycl::queue::memset. The operation is byte-wise:countbytes are set, each to the same valueval.Note
The returned event does not keep
memalive. Keepmemalive until the event completes, otherwise its USM allocation may be freed mid-operation, causing a use-after-free.- Parameters:
mem – Destination USM allocation, an instance of
dpctl.memory._Memory.val (int) – Value to fill
memwith. Followingsycl::queue::memset, it is interpreted as anunsigned char, i.e. only the least significant byte is used.count (int, optional) – Number of bytes to fill. If
0or greater than the size ofmem, the whole allocation is filled. Default:0.dEvents (List[dpctl.SyclEvent], optional) – Events that this operation depends on.
- Returns:
Event associated with the memset operation.
- Return type:
- Raises:
TypeError – If
memis not an instance ofdpctl.memory._Memory, ordEventsis not a sequence ofdpctl.SyclEvent.OverflowError – If
valdoes not fit in a Cintorcountis negative.RuntimeError – If the memset operation encountered an error.