aclrtSwitchLabelByIndex

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

√

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

√

Function

Switches to a position based on a label index, executes the tasks on the labeled stream, and stops the tasks on the current stream. This is an asynchronous API.

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

Returns

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