Function: memset_async

C Prototype

aclError aclrtMemsetAsync(void *devPtr, size_t maxCount, int32_t value, size_t count, aclrtStream stream)

Python Function

ret = acl.rt.memset_async(dev_ptr, max_count, value, count, stream)

Function Usage

Initializes the memory and sets the content in the memory to a specified value. It is an asynchronous interface.

The system determines whether the memory to be initialized is on the host or device side based on the address.

Input Description

dev_ptr: int, start address of the memory.

max_count: int, maximum length of the memory, in bytes.

value: int, configured value.

count: int, length of the memory to be set to a specified value, in bytes.

stream: int, pointer address of the stream.

Return Value

ret: int, error code.

Restrictions

This API is asynchronous. The API call delivers a task rather than executes a task. After calling this API, you need to call a synchronization API, such as acl.rt.synchronize_stream, to ensure that the memory initialization task is complete.