aclmdlFinalizeDump
Description
Deinitializes the dump.
- Record dump data to files.aclmdlInitDump, aclmdlSetDump, and aclmdlFinalizeDump work together to record dump data to files. These APIs can be called for multiple times in a single process to obtain dump data of different dump configurations. The specific scenarios are exemplified as follows:
- To execute two different models, you need to set dump configurations differently. The API call sequence is as follows: aclInit --> aclmdlInitDump --> aclmdlSetDump --> model 1 loading --> model 1 execution --> aclmdlFinalizeDump --> model 1 unloading --> aclmdlInitDump --> aclmdlSetDump --> model 2 loading --> model 2 execution --> aclmdlFinalizeDump --> model 2 unloading --> execution of other tasks --> aclFinalize
- To execute the same model twice, you only need to perform the dump operation for the first execution. The API call sequence is as follows: aclInit --> aclmdlInitDump --> aclmdlSetDump --> model loading --> model execution --> aclmdlFinalizeDump --> model unloading --> model loading --> model execution --> execution of other tasks --> aclFinalize
- Do not record dump data to files and directly obtain dump data by using a 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:
- Execute a model and obtain dump data through callback.
aclInit --> acldumpRegCallback --> aclmdlInitDump --> model loading --> model execution --> aclmdlFinalizeDump --> acldumpUnregCallback --> model unloading --> aclFinalize
- Execute two different models and obtain dump data through callback. In this context, as long as the callback function is not deregistered by calling acldumpUnregCallback, you can obtain the dump data of both models through the callback function.
aclInit --> acldumpRegCallback --> aclmdlInitDump --> model 1 loading --> model 1 execution -->--> model 2 loading --> model 2 execution --> aclmdlFinalizeDump --> model unloading --> acldumpUnregCallback --> aclFinalize
- Execute a model and obtain dump data through callback.
Prototype
aclError aclmdlFinalizeDump()
Parameters
None
Returns
The value 0 indicates success, and other values indicate failure. For details, see aclError.
Related APIs
AscendCL also provides the aclInit API. During AscendCL initialization, the dump configuration is passed as a JSON configuration file to dump the app data at run time. In this mode, aclInit can be called only once in a process. To change the dump configuration, modify the JSON configuration file.