Adds a callback function to a stream. This API is asynchronous.
aclError aclrtLaunchCallback(aclrtCallback fn, void *userData, aclrtCallbackBlockType blockType, aclrtStream stream)
Parameter |
Input/Output |
Description |
|---|---|---|
fn |
Input |
Callback function. Prototype: typedef void (*aclrtCallback)(void *userData) |
userData |
Input |
Pointer to the user specified data to be passed to the callback function. |
blockType |
Input |
Whether the callback function blocks the device. typedef enum aclrtCallbackBlockType {
ACL_CALLBACK_NO_BLOCK, //Not blocked (not supported by the Ascend 310 AI Processor)
ACL_CALLBACK_BLOCK, //Blocked
} aclrtCallbackBlockType; |
stream |
Input |
Stream. |
0 on success; else, failure.