Function: destroy_context

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

√

Atlas A2 training products / Atlas A2 inference products

√

Atlas training products

√

Atlas inference products

√

Atlas 200I/500 A2 inference products

√

Function Usage

Destroys a context and cleans up the associated resources. Only the context created by calling acl.rt.create_context can be destroyed.

Prototype

  • C Prototype
    1
    aclError aclrtDestroyContext(aclrtContext context)
    
  • Python Function
    1
    ret = acl.rt.destroy_context(context)
    

Parameter Description

Parameter

Description

context

Int, pointer address of the context object to be destroyed.

Return Value Description

Return Value

Description

ret

Int, error code: 0 on success; else, failure.

Reference

For details about the API call sequence and example, see Runtime Resource Allocation and Deallocation and Synchronous Wait.