aclrtSwitchLabelByIndex

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

Jumps to a position based on a label index, executes the tasks in the stream of the label, and stops the tasks in the current stream. This API is asynchronous.

Prototype

1
aclError aclrtSwitchLabelByIndex(void *ptr, uint32_t maxValue, aclrtLabelList labelList, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

ptr

Input

Label index.

Device memory address for storing the target label index. The index is of the UInt32 data type, the length is 4 bytes, and the index starts from 0.

If the target label index is greater than the maximum index value of the labelList array, the maximum label will be jumped to.

maxValue

Input

Number of labels in the label list.

labelList

Input

Label list. For details about the type definition, see aclrtLabelList.

Use a label list created by calling the aclrtCreateLabelList API as the input.

stream

Input

Stream for executing the jump task. For details about the type definition, see aclrtStream.

Returns

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