aclrtStreamAbort

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

x

Atlas inference products

x

Atlas training products

x

Description

Stops tasks that are being executed in a specified stream and discards tasks that have been delivered but not executed in the specified stream. New tasks delivered to the specified stream do not take effect during the execution of this API.

Prototype

aclError aclrtStreamAbort(aclrtStream stream)

Parameters

Parameter

Input/Output

Description

stream

Input

Stream with tasks to be stopped.

Passing NULL is not supported. Otherwise, an error will be reported.

aclmdlRIBindStream cannot be used to bind a stream to a model running instance.

Returns

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

Restrictions

If other streams depend on the stream specified by this API (for example, using aclrtRecordEvent or aclrtStreamWaitEvent to synchronize two streams), the execution of other streams may be suspended. In this case, you need to explicitly call this API to clear tasks on other streams.

If you call this API to clear tasks on a specified stream and then call a synchronization API (such as aclrtSynchronizeStream or aclrtSynchronizeEvent), the synchronization API exits and returns ACL_ERROR_RT_STREAM_ABORT.