aclInitCallbackRegister

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product/Atlas A3 inference product

Atlas A2 training product/Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

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

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.