aclrtSetStreamFailureMode

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

Specifies the task scheduling mode to determine whether to continue the next task after a task fails, when multiple tasks are delivered to a stream.

Prototype

1
aclError aclrtSetStreamFailureMode(aclrtStream stream, uint64_t mode)

Parameters

Parameter

Input/Output

Description

stream

Input

Stream to be operated. For details about the type definition, see aclrtStream.

mode

Input

Task scheduling mode. When multiple tasks are delivered to a stream, you can use this parameter to specify the task scheduling mode to determine whether to continue the next task after a task fails.

The value can be:

  • ACL_CONTINUE_ON_FAILURE: default value. If a task fails, the system continues to execute the next task.
  • ACL_STOP_ON_FAILURE: If a task fails, the subsequent tasks are not executed. This mode is also called stop-on-failure. After stop-on-failure is triggered, new tasks cannot be delivered.

Returns

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

Restrictions

  • This API can be called only once for a specified stream to set the task scheduling mode.
  • If stop-on-failure is set for a stream, the stop-on-failure mode also applies to other streams in the context of the stream.
  • For the Ascend 950PR / Ascend 950DT , Atlas A3 training products / Atlas A3 inference products and Atlas A2 training products / Atlas A2 inference products , the default stream can be used (that is, the stream parameter can be set to NULL).
  • For Atlas 200I/500 A2 inference products , Atlas inference products , and Atlas training products , the default stream cannot be used (that is, the stream parameter cannot be set to NULL).

API Call Example

For the API call example, see Task Stopping Upon Failure.