Function: destroy_stream
Applicable Products
- Ascend 950PR&950DT products: Supported
- Atlas A3 products: Supported
- Atlas A2 products: Supported
- Atlas 200I/500 A2 inference products: Supported
- Atlas inference products: Supported
- Atlas training products: Supported
Function
Destroys a stream created by calling acl.rt.create_stream or acl.rt.create_stream_with_config. If there are unfinished tasks on the stream, the stream is destroyed after the tasks are complete.
Prototype
-
C Prototype
aclError aclrtDestroyStream(aclrtStream stream) -
Python Function
ret = acl.rt.destroy_stream(stream)
Parameters
| Parameter | Description |
|---|---|
| stream | Int, pointer address of the stream to be destroyed. |
Return Values
| Return Value | Description |
|---|---|
| ret | Int, error code. If 0 is returned, the operation is successful. If other values are returned, the operation fails. |
Constraints
- Before calling acl.rt.destroy_stream to destroy a specified stream, call acl.rt.synchronize_stream to ensure that all tasks in the stream are complete.
- When calling acl.rt.destroy_stream to destroy a specified stream, ensure that the stream is in the current context.
- Before calling acl.rt.destroy_stream to destroy a specified stream, ensure that the stream is not being used by other APIs.
Reference
For details about the API call process and example, see "Runtime Resource Allocation and Deallocation" and "Synchronous Wait" in "Application Development (Python)".