diff options
author | Tai Ly <tai.ly@arm.com> | 2023-03-28 22:06:56 +0000 |
---|---|---|
committer | Tai Ly <tai.ly@arm.com> | 2023-05-05 19:23:15 +0000 |
commit | a4d748b08accce06fab93e2d2b96e499b35ae89b (patch) | |
tree | 20a3957e1f45f65f35d5d67ecce1618659e388f0 /reference_model/src/ops/comparison.h | |
parent | 0c71686875618b2e11290273b7a05b88ef8a8aae (diff) | |
download | reference_model-a4d748b08accce06fab93e2d2b96e499b35ae89b.tar.gz |
[reference model] Add precise mode
This adds --precise_mode=1 option to tosa_referece_model,
which will cause reference model to convert all floating point tensors
to FP64 tensors and compute all operators accordingly.
Also adds optional -p arguments to test runners tosa_verif_run_tests.py
and tosa_verif_framework_compiler_runner.py to run tests in precise mode
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I156055216ad61710096497a8fa1a653be2a602a3
Diffstat (limited to 'reference_model/src/ops/comparison.h')
-rw-r--r-- | reference_model/src/ops/comparison.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/reference_model/src/ops/comparison.h b/reference_model/src/ops/comparison.h index 29e6b5a..263df6a 100644 --- a/reference_model/src/ops/comparison.h +++ b/reference_model/src/ops/comparison.h @@ -1,5 +1,5 @@ -// Copyright (c) 2020, ARM Limited. +// Copyright (c) 2020-2023, ARM Limited. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,45 +24,45 @@ using namespace tosa; namespace TosaReference { -template <int Rank, DType Dtype> -class OpEqual : public BinaryNode<Rank, Dtype, DType_BOOL> +template <int Rank, TOSA_REF_TYPE Dtype> +class OpEqual : public BinaryNode<Rank, Dtype, TOSA_REF_TYPE_BOOL> { public: OpEqual(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_) - : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_EQUAL, id_) + : BinaryNode<Rank, Dtype, TOSA_REF_TYPE_BOOL>(sgt_, Op_EQUAL, id_) { register_fcn(); } using InEigenType = typename GetEigenType<Dtype>::type; - using OutEigenType = typename GetEigenType<DType_BOOL>::type; + using OutEigenType = typename GetEigenType<TOSA_REF_TYPE_BOOL>::type; virtual int register_fcn(); }; -template <int Rank, DType Dtype> -class OpGreater : public BinaryNode<Rank, Dtype, DType_BOOL> +template <int Rank, TOSA_REF_TYPE Dtype> +class OpGreater : public BinaryNode<Rank, Dtype, TOSA_REF_TYPE_BOOL> { public: OpGreater(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_) - : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_GREATER, id_) + : BinaryNode<Rank, Dtype, TOSA_REF_TYPE_BOOL>(sgt_, Op_GREATER, id_) { register_fcn(); } using InEigenType = typename GetEigenType<Dtype>::type; - using OutEigenType = typename GetEigenType<DType_BOOL>::type; + using OutEigenType = typename GetEigenType<TOSA_REF_TYPE_BOOL>::type; virtual int register_fcn(); }; -template <int Rank, DType Dtype> -class OpGreaterEqual : public BinaryNode<Rank, Dtype, DType_BOOL> +template <int Rank, TOSA_REF_TYPE Dtype> +class OpGreaterEqual : public BinaryNode<Rank, Dtype, TOSA_REF_TYPE_BOOL> { public: OpGreaterEqual(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_) - : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_EQUAL, id_) + : BinaryNode<Rank, Dtype, TOSA_REF_TYPE_BOOL>(sgt_, Op_EQUAL, id_) { register_fcn(); } using InEigenType = typename GetEigenType<Dtype>::type; - using OutEigenType = typename GetEigenType<DType_BOOL>::type; + using OutEigenType = typename GetEigenType<TOSA_REF_TYPE_BOOL>::type; virtual int register_fcn(); }; |