aclInitCallbackRegister

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

Registers the 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

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

Parameters

Parameter

Input/Output

Description

type

Input

Registration type, which is differentiated by function.

cbFunc

Input

Initialization callback function.

The prototype of the callback function is as follows:

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; else, failure. For details, see aclError.