aclrtStreamAbort

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

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. During the execution of this API, new tasks delivered to the specified stream do not take effect.

Restrictions

If other streams depend on the stream specified in this API (for example, two streams are synchronized by using the aclrtRecordEvent and aclrtStreamWaitEvent APIs), 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 this API is called to clear tasks on a specified stream and then the synchronization waiting API (such as aclrtSynchronizeStream and aclrtSynchronizeEvent) is called, the synchronization waiting API exits and a ACL_ERROR_RT_STREAM_ABORT error is returned.

Prototype

aclError aclrtStreamAbort(aclrtStream stream)

Parameters

Parameter

Input/Output

Description

stream

Input

Specifies the stream of the task to be cleared.

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

Returns

The value 0 indicates success, and other values indicate failure. For details, see aclError.