Function: device_task_abort

Applicability

Product

Supported (√/x)

Atlas A3 training products/Atlas A3 inference products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

x

Atlas inference products

x

Atlas 200I/500 A2 inference products

x

Function Usage

Stops the tasks that are being executed on a specified device and discards the tasks that have been delivered to the device. This API allows you to set an infinite wait interval or a specific timeout interval. If a specific timeout interval is configured, the API returns an error when the timeout interval is exceeded after this API is called.

Prototype

  • C Prototype
    1
    aclErroraclrtDeviceTaskAbort(int32_t deviceId, uint32_t timeout);
    
  • Python Function
    1
    ret = acl.rt.device_task_abort(device_id, timeout)
    

Parameter Description

Parameter

Description

deviceId

Int, device ID. The value must be the same as the device ID in the set_device API.

timeout

Int, timeout interval.

The options are as follows:

  • 0: waits forever.
  • > 0: specific timeout interval, in milliseconds. The maximum timeout interval is 36 minutes.

Return Value Description

Return Value

Description

ret

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

Restrictions

This API is reserved and is not supported currently.