Function: get_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

Obtains the context of a thread.

Prototype

  • C Prototype
    1
    aclError aclrtGetCurrentContext(aclrtContext context)
    
  • Python Function
    1
    context, ret = acl.rt.get_context()
    

Parameter Description

None.

Return Value Description

Return Value

Description

context

Int, pointer address of the created context object.

ret

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

Restrictions

If you call acl.rt.set_context multiple times to set the context of the current thread, the context set last time is obtained.