From 64285a1f25e2c7b85ed1f00b7947403e92baea00 Mon Sep 17 00:00:00 2001 From: Grant Watson Date: Wed, 16 Nov 2022 15:32:39 +0000 Subject: 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 Change-Id: I5b60db4c56113110d8e75fe1152525d258233f9c --- reference_model/src/tensor.cc | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'reference_model/src/tensor.cc') diff --git a/reference_model/src/tensor.cc b/reference_model/src/tensor.cc index e9598c4..3cf4aa0 100644 --- a/reference_model/src/tensor.cc +++ b/reference_model/src/tensor.cc @@ -15,6 +15,7 @@ #include "tensor.h" #include "arith_util.h" +#include "array_proxy.h" #include "half.hpp" using namespace TosaReference; @@ -445,7 +446,7 @@ DEF_CTENSOR_COPY_VALUE_FROM(6, bool) #undef DEF_CTENSOR_COPY_VALUE_FROM -int TosaReference::Tensor::readfromVector(const std::vector& vals) +int TosaReference::Tensor::readfromVector(const ArrayProxy vals) { uint32_t elements = getElementCount(); switch (getDtype()) @@ -470,7 +471,7 @@ int TosaReference::Tensor::readfromVector(const std::vector& vals) return 0; } -int TosaReference::Tensor::readfromVector(const std::vector& vals) +int TosaReference::Tensor::readfromVector(const ArrayProxy vals) { uint32_t elements = getElementCount(); std::vector tensor(elements); @@ -502,7 +503,7 @@ int TosaReference::Tensor::readfromVector(const std::vector& v return 0; } -int TosaReference::Tensor::readfromVector(const std::vector& vals) +int TosaReference::Tensor::readfromVector(const ArrayProxy vals) { uint32_t elements = getElementCount(); switch (getDtype()) @@ -531,7 +532,7 @@ int TosaReference::Tensor::readfromVector(const std::vector& vals) return 0; } -int TosaReference::Tensor::readfromVector(const std::vector& vals) +int TosaReference::Tensor::readfromVector(const ArrayProxy vals) { uint32_t elements = getElementCount(); switch (getDtype()) @@ -555,7 +556,7 @@ int TosaReference::Tensor::readfromVector(const std::vector& vals) return 0; } -int TosaReference::Tensor::readfromVector(const std::vector& vals) +int TosaReference::Tensor::readfromVector(const ArrayProxy vals) { uint32_t elements = getElementCount(); @@ -580,7 +581,7 @@ int TosaReference::Tensor::readfromVector(const std::vector& vals return 0; } -int TosaReference::Tensor::writeToVector(std::vector& vals) +int TosaReference::Tensor::writeToVector(ArrayProxy vals) { uint32_t elements = getElementCount(); @@ -605,7 +606,7 @@ int TosaReference::Tensor::writeToVector(std::vector& vals) return 0; } -int TosaReference::Tensor::writeToVector(std::vector& vals) +int TosaReference::Tensor::writeToVector(ArrayProxy vals) { uint32_t elements = getElementCount(); std::vector tensor(elements); @@ -636,7 +637,7 @@ int TosaReference::Tensor::writeToVector(std::vector& vals) return 0; } -int TosaReference::Tensor::writeToVector(std::vector& vals) +int TosaReference::Tensor::writeToVector(ArrayProxy vals) { uint32_t elements = getElementCount(); @@ -665,7 +666,7 @@ int TosaReference::Tensor::writeToVector(std::vector& vals) return 0; } -int TosaReference::Tensor::writeToVector(std::vector& vals) +int TosaReference::Tensor::writeToVector(ArrayProxy vals) { uint32_t elements = getElementCount(); @@ -689,7 +690,7 @@ int TosaReference::Tensor::writeToVector(std::vector& vals) return 0; } -int TosaReference::Tensor::writeToVector(std::vector& vals) +int TosaReference::Tensor::writeToVector(ArrayProxy vals) { uint32_t elements = getElementCount(); -- cgit v1.2.1