aclrtLaunchCallback

Description

Adds a callback function to a stream. This API is asynchronous.

Prototype

aclError aclrtLaunchCallback(aclrtCallback fn, void *userData, aclrtCallbackBlockType blockType, aclrtStream stream)

Parameters

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.

Returns

0 on success; else, failure.

See Also