acldumpRegCallback

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 dump data callback function.

aclmdlInitDump, acldumpRegCallback, acldumpUnregCallback, and aclmdlFinalizeDump work together to obtain dump data through a callback function. The callback function registered through acldumpRegCallback needs to be implemented by users, and the implementation logic of the callback function must include the acquisition of the dump data and data length. The specific scenarios are exemplified as follows:

Prototype

1
aclError acldumpRegCallback(int32_t (* const messageCallback)(const acldumpChunk *, int32_t len), int32_t flag)

Parameters

Parameter

Input/Output

Description

messageCallback

Input

Pointer to the callback function, which is used to receive callback data.

  • The acldumpChunk structure is defined as follows. When implementing the messageCallback function, you can obtain values of parameters such as dataBuf and bufLen in the acldumpChunk structure to obtain the dump data and its length.
    typedef struct acldumpChunk  {
        char       fileName[ACL_DUMP_MAX_FILE_PATH_LENGTH];   // Name of the dump file to be written to a drive. ACL_DUMP_MAX_FILE_PATH_LENGTH indicates the maximum length of the file name, which is 4,096 currently.
        uint32_t   bufLen;                           // dataBuf data length, in bytes.
        uint32_t   isLastChunk;                      // Whether the dump data is the last chunk. The value 0 indicates that the dump data is not the last chunk, and the value 1 indicates that the dump data is the last chunk.
        int64_t    offset;                           // Offset of the content in the dump file. The value -1 indicates the added content of the file.
        int32_t    flag;                             // Reserved dump data flag. The current data has no flag.
        uint8_t    dataBuf[0];                       // Memory address of the dump data.
    } acldumpChunk;
  • len: length of acldumpChunk structure, in bytes.

flag

Input

Whether to write dump data to a drive after the callback API is called.

  • 0: no. Currently, only the value 0 is supported.

Returns

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