aclInitCallbackRegister

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

√

Atlas inference products

√

Atlas training products

√

Function

Registers an initialization callback function.

If this API is called before aclInit, the callback function is called during initialization. If this API is called after aclInit, the callback function is called immediately upon registration.

Prototype

1
aclError aclInitCallbackRegister(aclRegisterCallbackType type, aclInitCallbackFunc cbFunc, void *userData)

Parameters

Parameter

Input/Output

Description

type

Input

Registration type, which is distinguished by function. For details, see aclRegisterCallbackType.

cbFunc

Input

Initialization callback function.

Prototype:

typedef aclError (*aclInitCallbackFunc)(const char *configStr, size_t len, void *userData);

configStr must be the same as the content of the JSON file in the aclInit API. len indicates the length of the JSON file content, in bytes.

userData

Input

Pointer to the user data to be passed to the callback function.

Returns

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