aclrtCmoAsyncWithBarrier

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

Implements cache memory operations on the device while carrying barrierId. barrierId indicates the barrier ID of a cache memory operation. This API is asynchronous.

Prototype

aclError aclrtCmoAsyncWithBarrier(void *src, size_t size, aclrtCmoType cmoType, uint32_t barrierId, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

src

Input

Address of the device memory to be operated.

Only cache memory operations on the local device are supported.

size

Input

Size of the device memory to be operated, in bytes.

cmoType

Input

Cache memory operation type.

barrierId

Input

Barrier ID.

If cmoType is set to ACL_RT_CMO_TYPE_INVALID, barrierId is valid. You can pass a number greater than 0 to this parameter. Use this parameter together with the aclrtCmoWaitBarrier API to wait for the invalid memory operation task with the specified barrier ID to complete. If cmoType is set to other values, the value of barrierId is fixed at 0.

stream

Input

Stream for executing the memory operation task.

Only a stream bound to the model is supported. To bind a stream to the model, call the aclmdlRIBindStream API.

Returns

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