res->append();
res->append("ANeuralNetworksExecution_create(", compilation, ", &execution);");
- // TODO Invoke setInput & setOutput method
- res->append(S(assert("NYI");));
+ // Emit ANeuralNetworksExecution_setInput call(s)
+ for (uint32_t n = 0; n < binder->module()->input()->size(); ++n)
+ {
+ auto bag = binder->input(n);
+ auto base = _mem.base(bag);
+ auto size = _mem.size(bag);
+
+ res->append("ANeuralNetworksExecution_setInput(execution, ", n, ", nullptr, ", base, ", ", size,
+ ");");
+ }
+
+ // Emit ANeuralNetworksExecution_setOutput call(s)
+ for (uint32_t n = 0; n < binder->module()->output()->size(); ++n)
+ {
+ auto bag = binder->output(n);
+ auto base = _mem.base(bag);
+ auto size = _mem.size(bag);
+
+ res->append("ANeuralNetworksExecution_setOutput(execution, ", n, ", nullptr, ", base, ", ",
+ size, ");");
+ }
res->append("ANeuralNetworksExecution_startCompute(execution, &event);");
res->append("ANeuralNetworksEvent_wait(event);");