aclrtMemset

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

Initializes memory to a specified value.

The system determines whether the memory to be initialized is on the host or device based on the address. If the host memory is not allocated by calling an acl API (for example, aclrtMallocHost), undefined behavior will occur.

Prototype

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

Parameters

Parameter

Input/Output

Description

devPtr

Input

Pointer to the start address of the memory.

maxCount

Input

Maximum memory size, in bytes.

value

Input

Value to set.

count

Input

Memory size to set, in bytes

Returns

0 on success; else, failure. For details, see aclError.

Restrictions

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