aclrtSwitchLabelByIndex

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

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

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.

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

stream

Input

Stream for executing the jump task.

Returns

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