diff options
author | Jiacheng Liang <jiacheng.liang@arm.com> | 2023-07-14 12:43:46 +0100 |
---|---|---|
committer | Jiacheng Liang <jiacheng.liang@arm.com> | 2023-07-14 12:56:04 +0100 |
commit | e7c7cab69c2f02d86474c60ed04debc0e7c7bf65 (patch) | |
tree | 3c9e839e20576031d298771f23a7a51c37d6ebd1 /reference_model/src/model_runner_impl.cc | |
parent | 6c93f41dcb781dde1351ecff549df2a753d5e9c6 (diff) | |
download | reference_model-e7c7cab69c2f02d86474c60ed04debc0e7c7bf65.tar.gz |
Add support for int32 tensor datatype in model runner
Signed-off-by: Jiacheng Liang <jiacheng.liang@arm.com>
Change-Id: Ie31041cbcd01f6290be06eabfe5c619123ae989f
Diffstat (limited to 'reference_model/src/model_runner_impl.cc')
-rw-r--r-- | reference_model/src/model_runner_impl.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/reference_model/src/model_runner_impl.cc b/reference_model/src/model_runner_impl.cc index 31e100a..f1b70e7 100644 --- a/reference_model/src/model_runner_impl.cc +++ b/reference_model/src/model_runner_impl.cc @@ -198,6 +198,12 @@ int ModelRunnerImpl::setInput(std::string input_name, uint8_t* raw_ptr, size_t s status = setInput(input_name, ArrayProxy(elements, typed_ptr)); break; } + case TOSA_REF_TYPE_INT32: { + auto typed_ptr = reinterpret_cast<int*>(raw_ptr); + const int elements = size / sizeof(int); + status = setInput(input_name, ArrayProxy(elements, typed_ptr)); + break; + } default: status = 1; } @@ -270,6 +276,12 @@ int ModelRunnerImpl::getOutput(std::string output_name, uint8_t* raw_ptr, size_t status = tensor->writeToVector(ArrayProxy(elements, typed_ptr)); break; } + case TOSA_REF_TYPE_INT32: { + auto typed_ptr = reinterpret_cast<int*>(raw_ptr); + const int elements = size / sizeof(int); + status = tensor->writeToVector(ArrayProxy(elements, typed_ptr)); + break; + } default: status = 1; } |