aboutsummaryrefslogtreecommitdiff
path: root/reference_model/include/model_runner.h
diff options
context:
space:
mode:
authorGrant Watson <grant.watson@arm.com>2022-11-16 15:32:39 +0000
committerEric Kunze <eric.kunze@arm.com>2022-12-15 16:41:27 +0000
commit64285a1f25e2c7b85ed1f00b7947403e92baea00 (patch)
tree6d29c54f6497741449339e808508c854ba6a2267 /reference_model/include/model_runner.h
parentb45db9a696f5df7b233f374248f329c16ee7ae64 (diff)
downloadreference_model-64285a1f25e2c7b85ed1f00b7947403e92baea00.tar.gz
Extend reference model API with eager operator execution entrypoints
- Adds a script to generate operators.h and operators.cc - Adds jinja2 templates for generating operators.h and operators.cc - Adds unit tests for a subset of the operators generated - Includes the TOSA specification as a submodule - Adds supporting C++ and header files Signed-off-by: Grant Watson <grant.watson@arm.com> Change-Id: I5b60db4c56113110d8e75fe1152525d258233f9c
Diffstat (limited to 'reference_model/include/model_runner.h')
-rw-r--r--reference_model/include/model_runner.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/reference_model/include/model_runner.h b/reference_model/include/model_runner.h
index 4335794..86d0056 100644
--- a/reference_model/include/model_runner.h
+++ b/reference_model/include/model_runner.h
@@ -71,6 +71,13 @@ public:
int setInput(std::string input_name, std::vector<T>& vals);
/*
+ * Set the input tensors for the model through a raw byte buffer.
+ * The input_name much match the input tensor name in the model.
+ * NOTE: setInput() must be called for each input tensor before run() is called.
+ */
+ int setInput(std::string input_name, uint8_t* raw_ptr, size_t size);
+
+ /*
* Retrieve the output tensors from the graph after running.
* The output_name much match the output tensor name in the model.
* NOTE: run() must be called before outputs are retrieved.
@@ -78,6 +85,13 @@ public:
template <typename T>
std::vector<T> getOutput(std::string output_name);
+ /*
+ * Retrieve the output tensors from the graph after running in a raw byte buffer.
+ * The output_name much match the output tensor name in the model.
+ * NOTE: run() must be called before outputs are retrieved.
+ */
+ int getOutput(std::string output_name, uint8_t* raw_ptr, size_t size);
+
private:
std::unique_ptr<ModelRunnerImpl> model_runner_impl;
};