|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Explicitly creates a context in the calling process or thread.
For the
For the
For the
For the
For the
If acl.rt.set_device is not called in the application, when acl.rt.create_context is called for the first time, the system binds a default stream to the device based on the device ID passed by the API (one device is bound to only one default stream). Therefore, when acl.rt.create_context is called for the first time, the number of occupied streams is calculated as follows: Number of occupied streams = Number of default streams bound to the device + Number of streams contained in the context.
1
|
aclError aclrtCreateContext(aclrtContext *context, int32_t deviceId) |
1
|
context, ret = acl.rt.create_context(device_id) |
|
Parameter |
Description |
|---|---|
|
device_id |
Int, ID of the device for which the context is to be created. |
|
Return Value |
Description |
|---|---|
|
context |
Int, pointer address of the created context. |
|
ret |
Int, error code. 0 on success; else, failure. |
The following application scenarios are supported:
For details about the API call sequence and examples, see Runtime Resource Allocation and Deallocation.