From 2b201c340788ac582cec160b7217c2b5405b04f9 Mon Sep 17 00:00:00 2001 From: Kristofer Jonsson Date: Wed, 2 Sep 2020 16:42:43 +0200 Subject: Move fast memory area to core driver Change-Id: Ie4186f5ab881d5c13021299404322ff582180d26 --- include/ethosu_driver.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/ethosu_driver.h b/include/ethosu_driver.h index 64ccb89..d6e9c6d 100644 --- a/include/ethosu_driver.h +++ b/include/ethosu_driver.h @@ -26,6 +26,7 @@ #include "ethosu_device.h" #include +#include #include #ifdef __cplusplus @@ -40,6 +41,8 @@ struct ethosu_driver { struct ethosu_device dev; bool abort_inference; + uint64_t fast_memory; + size_t fast_memory_size; }; struct ethosu_version_id @@ -79,7 +82,9 @@ struct ethosu_version /** * Initialize the Ethos-U driver. */ -int ethosu_init(const void *base_address); +int ethosu_init_v2(const void *base_address, const void *fast_memory, const size_t fast_memory_size); + +#define ethosu_init(base_address) ethosu_init_v2(base_address, NULL, 0) /** * Get Ethos-U version. @@ -89,10 +94,15 @@ int ethosu_get_version(struct ethosu_version *version); /** * Invoke Vela command stream. */ -int ethosu_invoke(const void *custom_data_ptr, - const int custom_data_size, - const uint64_t *base_addr, - const int num_base_addr); +int ethosu_invoke_v2(const void *custom_data_ptr, + const int custom_data_size, + const uint64_t *base_addr, + const size_t *base_addr_size, + const int num_base_addr); + +#define ethosu_invoke(custom_data_ptr, custom_data_size, base_addr, num_base_addr) \ + ethosu_invoke_v2(custom_data_ptr, custom_data_size, base_addr, NULL, num_base_addr) + /** * Abort Ethos-U inference. */ -- cgit v1.2.1