|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Specifies the thread that processes the callback function in the stream in the asynchronous task scenario.
1
|
aclError aclrtSubscribeReport(uint64_t threadId, aclrtStream stream) |
1
|
ret = acl.rt.subscribe_report(thread_id, stream) |
|
Parameter |
Description |
|---|---|
|
thread_id |
Int, thread ID. |
|
stream |
Int, pointer address of the stream to be processed. |
|
Return Value |
Description |
|---|---|
|
ret |
Int, error code. 0 on success; else, failure. |
acl.rt.subscribe_report 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, acl.rt.subscribe_report cannot be called to subscribe to multiple threads for processing more than one callback function in the same stream.
Considering the thread switching performance overhead of the operating system, try to keep the number of threads subscribed by this call within 32.
It is not allowed to pass the same thread ID for subscribing to different callback functions on different devices in the same process.