Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 1 | |
| 2 | // Copyright (c) 2020, ARM Limited. |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | |
| 16 | #ifndef OPS_COMPARISON_H |
| 17 | #define OPS_COMPARISON_H |
| 18 | |
| 19 | #include "ewise_binary.h" |
| 20 | #include "graph_node.h" |
| 21 | |
| 22 | using namespace tosa; |
| 23 | |
| 24 | namespace TosaReference |
| 25 | { |
| 26 | |
| 27 | template <int Rank, DType Dtype> |
| 28 | class OpEqual : public BinaryNode<Rank, Dtype, DType_BOOL> |
| 29 | { |
| 30 | public: |
Eric Kunze | b5fabec | 2022-06-07 05:20:44 +0000 | [diff] [blame] | 31 | OpEqual(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_) |
| 32 | : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_EQUAL, id_) |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 33 | { |
| 34 | register_fcn(); |
| 35 | } |
| 36 | using InEigenType = typename GetEigenType<Dtype>::type; |
| 37 | using OutEigenType = typename GetEigenType<DType_BOOL>::type; |
| 38 | virtual int register_fcn(); |
| 39 | }; |
| 40 | |
| 41 | template <int Rank, DType Dtype> |
| 42 | class OpGreater : public BinaryNode<Rank, Dtype, DType_BOOL> |
| 43 | { |
| 44 | public: |
Eric Kunze | b5fabec | 2022-06-07 05:20:44 +0000 | [diff] [blame] | 45 | OpGreater(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_) |
| 46 | : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_GREATER, id_) |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 47 | { |
| 48 | register_fcn(); |
| 49 | } |
| 50 | using InEigenType = typename GetEigenType<Dtype>::type; |
| 51 | using OutEigenType = typename GetEigenType<DType_BOOL>::type; |
| 52 | virtual int register_fcn(); |
| 53 | }; |
| 54 | |
| 55 | template <int Rank, DType Dtype> |
| 56 | class OpGreaterEqual : public BinaryNode<Rank, Dtype, DType_BOOL> |
| 57 | { |
| 58 | public: |
Eric Kunze | b5fabec | 2022-06-07 05:20:44 +0000 | [diff] [blame] | 59 | OpGreaterEqual(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_) |
| 60 | : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_EQUAL, id_) |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 61 | { |
| 62 | register_fcn(); |
| 63 | } |
| 64 | using InEigenType = typename GetEigenType<Dtype>::type; |
| 65 | using OutEigenType = typename GetEigenType<DType_BOOL>::type; |
| 66 | virtual int register_fcn(); |
| 67 | }; |
| 68 | |
| 69 | }; // namespace TosaReference |
| 70 | |
| 71 | #endif |