aclrtSnapShotCallbackRegister

Note: This API is for trial use and may be changed in later versions. It is not available in production environments.

Applicable Products

Product

Supported

Ascend 950PR

√

Ascend 950DT

☓

Atlas A3 training products/Atlas A3 inference products

√

Atlas A2 training products/Atlas A2 inference products

√

Atlas 200I/500 A2 inference products

x

Atlas inference products

x

Atlas training products

x

Function

Registers a callback function to be called at a specific phase of a snapshot operation. Repeated registration is not supported.

Prototype

1
aclError aclrtSnapShotCallbackRegister(aclrtSnapShotStage stage, aclrtSnapShotCallBack callback, void *args)

Parameters

Parameter

Input/Output

Description

stage

Input

Snapshot phase for triggering the callback. For details about the type definition, see aclrtSnapShotStage.

callback

Input

Pointer to the callback function. Once the specified snapshot phase is reached, the system automatically calls this function.

Function definition:

typedef uint32_t (*aclrtSnapShotCallBack)(int32_t deviceId, void* args);

args

Input

Pointer to user-defined parameters passed when the callback function is called. The parameter value can be NULL, indicating that no additional parameters need to be passed.

Returns

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