aclrtSubscribeHostFunc

Applicability

Product

Supported

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas 200I/500 A2 inference products

Atlas inference products

Atlas training products

Description

Subscribes to a thread you have created for processing the callback function in a stream.

Prototype

aclError aclrtSubscribeHostFunc(uint64_t hostFuncThreadId, aclrtStream exeStream)

Parameters

Parameter

Input/Output

Description

hostFuncThreadId

Input

Thread ID.

exeStream

Input

Stream.

Returns

0 on success; else, failure. For details, see aclError.

Restrictions

  • aclrtSubscribeHostFunc can be called 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, aclrtSubscribeHostFunc cannot be called to subscribe to multiple threads for processing more than one callback function in the same stream.