aboutsummaryrefslogtreecommitdiff
path: root/reference_model/src/ops/ewise_binary.h
diff options
context:
space:
mode:
authorKevin Cheng <kevin.cheng@arm.com>2021-05-24 17:20:01 -0700
committerKevin Cheng <kevin.cheng@arm.com>2021-05-24 17:20:21 -0700
commit571f7182a10a974f1ce993d83b01070153f142cc (patch)
tree1cdc94294b24ec5d4719219e46d39ddc2e674652 /reference_model/src/ops/ewise_binary.h
parent47315e1af6947dd93729c6dbd034c7db1af7f312 (diff)
downloadreference_model-571f7182a10a974f1ce993d83b01070153f142cc.tar.gz
Support 8-bit TABLE op.
Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: If577035d71c5f9970df5b6a78640a3028c3f83c0
Diffstat (limited to 'reference_model/src/ops/ewise_binary.h')
-rw-r--r--reference_model/src/ops/ewise_binary.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/reference_model/src/ops/ewise_binary.h b/reference_model/src/ops/ewise_binary.h
index 6b9c98d..a5b1059 100644
--- a/reference_model/src/ops/ewise_binary.h
+++ b/reference_model/src/ops/ewise_binary.h
@@ -176,7 +176,7 @@ protected:
TosaMulAttribute* attribute;
};
-template <int Rank>
+template <int Rank, DType InDtype>
class OpTable : public GraphNode
{
public:
@@ -186,9 +186,8 @@ public:
virtual int checkTensorAttributes();
virtual int eval();
- static constexpr DType InDtype = DType_INT16;
- static constexpr DType TableDtype = DType_INT16;
- static constexpr DType OutDtype = DType_INT32;
+ static constexpr DType TableDtype = (InDtype == DType_INT8) ? DType_INT8 : DType_INT16;
+ static constexpr DType OutDtype = (InDtype == DType_INT8) ? DType_INT8 : DType_INT32;
using InEigenType = typename GetEigenType<InDtype>::type;
using TableEigenType = typename GetEigenType<TableDtype>::type;
using OutEigenType = typename GetEigenType<OutDtype>::type;