aclrtSwitchStream

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

x

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

Switches between streams based on conditions. This API is asynchronous.

After a successful switch, only the tasks on the target stream are executed, while those on the current stream are stopped.

Prototype

aclError aclrtSwitchStream(void *leftValue, aclrtCondition cond, void *rightValue, aclrtCompareDataType dataType, aclrtStream trueStream, aclrtStream falseStream, aclrtStream stream)

Parameters

Parameter

Input/Output

Description

leftValue

Input

Device memory address of the left-hand operand.

cond

Input

Comparison condition between the left-hand operand and the right-hand operand.

rightValue

Input

Device memory address of the right-hand operand.

dataType

Input

Data type of the left-hand and right-hand operands.

trueStream

Input

If the condition specified by cond is met, the task on trueStream is executed.

falseStream

Input

If the condition specified by cond is not met, the task on falseStream is executed.

stream

Input

Stream for executing the switching task.

Returns

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