Function: memset

C Prototype

aclError aclrtMemset(void *devPtr, size_t maxCount, int32_t value, size_t count)

Python Function

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

Function Usage

Initializes memory to a specified value.

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.

Return Value

ret: int, error code.

Restrictions

This API initializes the memory immediately. No implicit device synchronization or stream synchronization is performed within the function.