Streams Management
Function: create_stream
C Prototype |
aclError aclrtCreateStream(aclrtStream *stream) |
---|---|
Python Function |
stream, ret = acl.rt.create_stream() |
Function Usage |
Creates a stream. It is a synchronous interface. |
Input Description |
None |
Return Value |
stream: int, stream object pointer. ret: int, error code.
|
Restrictions |
The hardware supports a maximum of 1024 streams. If there are multiple default streams, only explicit streams can be created. The number of allowed explicit streams is calculated as follows: 1024 – Number of default streams – Number of streams for internal synchronization. For example, if a default stream and a stream for internal synchronization exist, only 1022 (= 1024 – 1 – 1) streams can be created explicitly. Each process corresponds to a default stream. The default stream is implicitly created when acl.rt.set_device is called to specify the device used for computation. The system reserves the default streams for a maximum of eight processes. You are advised to explicitly create a stream by calling acl.rt.create_stream.
|
Precautions |
None |
Function: destroy_stream
C Prototype |
aclError aclrtDestroyStream(aclrtStream stream) |
---|---|
Python Function |
ret = acl.rt.destroy_stream(stream) |
Function Usage |
Destroys a specified stream. Only the streams created by calling acl.rt.create_stream can be destroyed. It is a synchronous interface. |
Input Description |
stream: int, stream pointer to be destroyed. |
Return Value |
ret: int, error code.
|
Restrictions |
|
Precautions |
None |