Function: set_stream_failure_mode

C Prototype

aclError aclrtSetStreamFailureMode(aclrtStream stream, uint64_t mode)

Python Function

ret = acl.rt.set_stream_failure_mode(stream, mode)

Function Usage

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

The Atlas 200/300/500 Inference Product does not support this API in the current version.

Input Description

stream: int, pointer address of the stream to be operated.

stream cannot specify the task scheduling mode of the default stream (that is, setting this parameter to 0).

mode: int. 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 options are as follows:

  • ACL_CONTINUE_ON_FAILURE = 0: default value. If a task fails, the system continues to execute the next task.
  • ACL_STOP_ON_FAILURE = 1: After a task fails, the subsequent tasks are stopped.

Return Value

ret: int, error code.

Restrictions

None