From 7e8f508765632c42cc44fd8ad704c9d90943ab32 Mon Sep 17 00:00:00 2001 From: Davide Grohmann Date: Wed, 23 Mar 2022 12:48:45 +0100 Subject: Add support for inference cancellation Send cancel inference messages to the ethosu subsystem to abort inference execution there. Also mark inference as aborted in the linux driver stack itself, so pending inference messages are not resent when resetting the firmware. Change-Id: I244c2b119fd7995d14e3859815abf2a00c7f0583 --- kernel/ethosu_core_interface.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'kernel/ethosu_core_interface.h') diff --git a/kernel/ethosu_core_interface.h b/kernel/ethosu_core_interface.h index 76fe35e..057e3c2 100644 --- a/kernel/ethosu_core_interface.h +++ b/kernel/ethosu_core_interface.h @@ -59,6 +59,8 @@ enum ethosu_core_msg_type { ETHOSU_CORE_MSG_CAPABILITIES_RSP, ETHOSU_CORE_MSG_NETWORK_INFO_REQ, ETHOSU_CORE_MSG_NETWORK_INFO_RSP, + ETHOSU_CORE_MSG_CANCEL_INFERENCE_REQ, + ETHOSU_CORE_MSG_CANCEL_INFERENCE_RSP, ETHOSU_CORE_MSG_MAX }; @@ -98,6 +100,8 @@ enum ethosu_core_status { ETHOSU_CORE_STATUS_ERROR, ETHOSU_CORE_STATUS_RUNNING, ETHOSU_CORE_STATUS_REJECTED, + ETHOSU_CORE_STATUS_ABORTED, + ETHOSU_CORE_STATUS_ABORTING, }; /** @@ -216,6 +220,22 @@ struct ethosu_core_msg_capabilities_rsp { uint32_t custom_dma; }; +/** + * struct ethosu_core_cancel_inference_req - Message cancel inference request + */ +struct ethosu_core_cancel_inference_req { + uint64_t user_arg; + uint64_t inference_handle; +}; + +/** + * struct ethosu_core_cancel_inference_rsp - Message cancel inference response + */ +struct ethosu_core_cancel_inference_rsp { + uint64_t user_arg; + uint32_t status; +}; + /** * enum ethosu_core_msg_err_type - Error types */ -- cgit v1.2.1