aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2020-11-06 10:33:21 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2020-11-10 11:24:36 +0100
commit4c94b30eb19f168a5e81e27a26c8e25bdab005b1 (patch)
tree380fe4d7ebd9c461c644d0fb66a87fa258e50043
parentb58be1e46b5169e53869ea9ac48b528e555d944f (diff)
downloadethos-u-core-driver-20.11-rc1.tar.gz
Fast memory error handling20.11-rc1
Return error if the fast memory area would be smaller than the spilling tensor. Change-Id: Ica89a3a933a3317a346e3479f5209ddc735d1c91
-rw-r--r--src/ethosu_driver.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/ethosu_driver.c b/src/ethosu_driver.c
index 77b8727..d21e0a7 100644
--- a/src/ethosu_driver.c
+++ b/src/ethosu_driver.c
@@ -337,14 +337,13 @@ int ethosu_invoke_v2(const void *custom_data_ptr,
if (base_addr_size != NULL && base_addr_size[FAST_MEMORY_BASE_ADDR_INDEX] > ethosu_drv.fast_memory_size)
{
- LOG_WARN("Fast memory area too small. fast_memory_size=%u, base_addr_size=%u\n",
- ethosu_drv.fast_memory_size,
- base_addr_size[FAST_MEMORY_BASE_ADDR_INDEX]);
- }
- else
- {
- *fast_memory = ethosu_drv.fast_memory;
+ LOG_ERR("Fast memory area too small. fast_memory_size=%u, base_addr_size=%u\n",
+ ethosu_drv.fast_memory_size,
+ base_addr_size[FAST_MEMORY_BASE_ADDR_INDEX]);
+ return -1;
}
+
+ *fast_memory = ethosu_drv.fast_memory;
}
if (ethosu_drv.dev.reset != ethosu_read_reg(&ethosu_drv.dev, NPU_REG_PROT))