aboutsummaryrefslogtreecommitdiff
path: root/kernel/ethosu_mailbox.c
diff options
context:
space:
mode:
authorKristofer Jonsson <kristofer.jonsson@arm.com>2020-09-10 13:26:01 +0200
committerKristofer Jonsson <kristofer.jonsson@arm.com>2020-09-17 13:23:27 +0200
commitb74492c5aee3786b886951e87f4e5ea8d6032733 (patch)
tree76ef44dfdb68d68964877b0adba21cbce2416fe5 /kernel/ethosu_mailbox.c
parent116a635581f292cb4882ea1a086f842904f85c3c (diff)
downloadethos-u-linux-driver-stack-b74492c5aee3786b886951e87f4e5ea8d6032733.tar.gz
Support inferences with multiple inputs and outputs
Build flatbuffers library. Update network class to extract IFM and OFM dimensions from the tflite file. Update the uapi and core apis to support up to 16 IFM and OFM buffers per inference. Change-Id: I2f2f177aa4c2d5f9f50f23eb33c44e01ec2cbe09
Diffstat (limited to 'kernel/ethosu_mailbox.c')
-rw-r--r--kernel/ethosu_mailbox.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/kernel/ethosu_mailbox.c b/kernel/ethosu_mailbox.c
index 23a356e..47c4698 100644
--- a/kernel/ethosu_mailbox.c
+++ b/kernel/ethosu_mailbox.c
@@ -171,15 +171,25 @@ int ethosu_mailbox_ping(struct ethosu_mailbox *mbox)
int ethosu_mailbox_inference(struct ethosu_mailbox *mbox,
void *user_arg,
- struct ethosu_buffer *ifm,
- struct ethosu_buffer *ofm,
+ uint32_t ifm_count,
+ struct ethosu_buffer **ifm,
+ uint32_t ofm_count,
+ struct ethosu_buffer **ofm,
struct ethosu_buffer *network)
{
struct ethosu_core_inference_req inf;
+ uint32_t i;
inf.user_arg = (ptrdiff_t)user_arg;
- ethosu_core_set_size(ifm, &inf.ifm);
- ethosu_core_set_capacity(ofm, &inf.ofm);
+ inf.ifm_count = ifm_count;
+ inf.ofm_count = ofm_count;
+
+ for (i = 0; i < ifm_count; i++)
+ ethosu_core_set_size(ifm[i], &inf.ifm[i]);
+
+ for (i = 0; i < ofm_count; i++)
+ ethosu_core_set_capacity(ofm[i], &inf.ofm[i]);
+
ethosu_core_set_size(network, &inf.network);
return ethosu_queue_write_msg(mbox, ETHOSU_CORE_MSG_INFERENCE_REQ,