aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Elofsson <jens.elofsson@arm.com>2021-04-08 18:51:38 +0200
committerMåns Nilsson <mans.nilsson@arm.com>2021-05-21 11:23:12 +0200
commit04961a4adcefbf0ceeb610c1d1fe564079f90de6 (patch)
tree3ae703fcbf36f955f8ac77996365c11ee2bb53a4
parenteffc7aa8b9272fb20cdd1a7d1097818af70acc93 (diff)
downloadethos-u-core-driver-04961a4adcefbf0ceeb610c1d1fe564079f90de6.tar.gz
Add weak definition of ethosu_inference_begin/end to driver
Add ethosu_inference_begin/end calls to ethosu_invoke_v3. Change-Id: I52f08ab3e3524d4d8f73d8bca7dc9559438d4857
-rw-r--r--src/ethosu_driver.c14
1 files changed, 14 insertions, 0 deletions
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)
{