aclrtCmoAsyncWithBarrier

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

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

1
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. For details about the type definition, see aclrtCmoType.

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. For details about the type definition, see aclrtStream.

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.