aclFinalizeReference

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

Performs deinitialization to destroy the resources used by the acl API in the process.

aclFinalizeReference involves the implementation of reference counting. Each time aclInit is called, the reference count increases by 1. Each time aclFinalizeReference is called, the reference count decreases by 1. Deinitialization is performed only when the reference count decreases to 0. The difference between aclFinalize and this API is that if aclFinalize is called, the count is cleared, and deinitialization is performed directly.

Prototype

1
aclError aclFinalizeReference(uint64_t *refCount)

Parameters

Parameter

Input/Output

Description

refCount

Input/Output

Returns the reference count after aclFinalizeReference is called.

If the reference count is not required, you can pass nullptr.

Returns

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

Restrictions

Before the app 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 the app process exits.

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