Description
Subscribes to a thread for handling the callback function in a stream. This API is synchronous.
Restrictions
- aclrtSubscribeReport can be called for multiple times to subscribe to the same thread for processing the callback function in multiple streams of the same device.
- To ensure that tasks in a stream can be executed in order, do not call aclrtSubscribeReport to subscribe to multiple threads for processing more than one callback function in the same stream.
- Ascend 310 AI Processor: If the number of threads registered by this call in a single process exceeds 128, a failure code is returned.
- Ascend 910 AI Processor: If the number of threads registered by this call in a single process exceeds 1024, a failure code is returned.
- Ascend 310P Server: If the number of threads registered by this call in a single process exceeds 1024, a failure code is returned.
- Considering the thread switching performance overhead of the OS, try to keep the number of threads subscribed by this call within 32.
- Do not pass the same thread ID for subscribing to callback functions on different devices in the same process.
Parameters
Parameter |
Input/Output |
Description |
threadId |
Input |
Thread ID. |
stream |
Input |
Stream. |
Returns
0 on success; else, failure.