From 04961a4adcefbf0ceeb610c1d1fe564079f90de6 Mon Sep 17 00:00:00 2001 From: Jens Elofsson Date: Thu, 8 Apr 2021 18:51:38 +0200 Subject: Add weak definition of ethosu_inference_begin/end to driver Add ethosu_inference_begin/end calls to ethosu_invoke_v3. Change-Id: I52f08ab3e3524d4d8f73d8bca7dc9559438d4857 --- src/ethosu_driver.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c index 1442621..60034e6 100644 --- a/src/ethosu_driver.c +++ b/src/ethosu_driver.c @@ -259,6 +259,18 @@ static inline void wait_for_irq(struct ethosu_driver *drv) } } +void __attribute__((weak)) ethosu_inference_begin(struct ethosu_driver *drv, const void *inference_data) +{ + (void)inference_data; + (void)drv; +} + +void __attribute__((weak)) ethosu_inference_end(struct ethosu_driver *drv, const void *inference_data) +{ + (void)inference_data; + (void)drv; +} + static int handle_optimizer_config(struct ethosu_driver *drv, struct opt_cfg_s *opt_cfg_p); static int handle_command_stream(struct ethosu_driver *drv, const uint8_t *cmd_stream, @@ -434,6 +446,7 @@ int ethosu_invoke(struct ethosu_driver *drv, drv->status_error = false; + ethosu_inference_begin(drv, custom_data_ptr); while (data_ptr < data_end) { int ret = 0; @@ -495,6 +508,7 @@ int ethosu_invoke(struct ethosu_driver *drv, break; } } + ethosu_inference_end(drv, custom_data_ptr); if (!drv->status_error && !drv->dev_power_always_on) { -- cgit v1.2.1