|
Product |
Supported (√/x) |
|---|---|
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
|
|
√ |
Resets the current device and releases the resources on the device. The resources to be released include the default context, default stream, and all streams created in the default context. If a task in the default context or stream is not complete, the system releases the context or stream after the task is complete.
1
|
aclError aclrtResetDevice(int32_t deviceId) |
1
|
ret = acl.rt.reset_device(device_id) |
|
Parameter |
Description |
|---|---|
|
device_id |
Int, device ID. |
|
Return Value |
Description |
|---|---|
|
ret |
Int, error code. 0 on success; else, failure. |
If there are explicitly created contexts, streams, or events on the device to be reset, you are advised to follow the following call sequence before resetting. Otherwise, exceptions may occur.
The API call sequence is as follows: call acl.rt.destroy_event to destroy the event or call acl.rt.destroy_stream to destroy the explicitly created stream --> call acl.rt.destroy_context to destroy the explicitly created context --> call acl.rt.reset_device.
For details about the API call sequence and examples, see Runtime Resource Allocation and Deallocation and Synchronous Wait.