aclFinalize

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

Performs deinitialization to release resources used by acl APIs in a process.

In scenarios where device service logs need to be sent back to the host, this API adds a delay of 2,000 ms by default (the actual maximum delay can reach 2,000 ms) to ensure that ERROR and EVENT logs are sent back and no data is lost. You can set the ASCEND_LOG_DEVICE_FLUSH_TIMEOUT environment variable to 0 (command example: export ASCEND_LOG_DEVICE_FLUSH_TIMEOUT=0) to cancel the default delay. For details about the ASCEND_LOG_DEVICE_FLUSH_TIMEOUT environment variable, see Environment Variables in Logs > ASCEND_LOG_DEVICE_FLUSH_TIMEOUT.

Prototype

1
aclError aclFinalize()

Parameters

None

Returns

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

Restrictions

Before an application process exits, ensure that aclFinalize or aclFinalizeReference has been called to complete deinitialization. Otherwise, there may be exceptions. For example, an error is reported when an application process exits.

You are not advised to call aclFinalize or aclFinalizeReference in a destructor. Otherwise, the process may exit abnormally due to the unknown singleton destruction order.

API Call Example

For the API call example, see Initialization.