Function: get_context
Applicable Products
- Ascend 950PR&950DT products: Supported
- Atlas A3 products: supported
- Atlas A2 products: Supported
- Atlas 200I/500 A2 inference products: Supported
- Atlas inference products: Supported
- Atlas training products: Supported
Function
Obtains the context of a thread.
Prototype
-
C Prototype
aclError aclrtGetCurrentContext(aclrtContext *context) -
Python Function
context, ret = acl.rt.get_context()
Parameters
None
Return Values
| Return Value | Description |
|---|---|
| context | Int, pointer address of the created context object. |
| ret | Int, error code. If 0 is returned, the operation is successful. If other values are returned, the operation fails. |
Constraints
If you call acl.rt.set_context multiple times to set the context of the current thread, the context set last time is obtained.