blob: 29e6b5a9e446f2002cfbc5ee4a0981f02487ad2f [file] [log] [blame]
Eric Kunzee5e26762020-10-13 16:11:07 -07001
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
22using namespace tosa;
23
24namespace TosaReference
25{
26
27template <int Rank, DType Dtype>
28class OpEqual : public BinaryNode<Rank, Dtype, DType_BOOL>
29{
30public:
Eric Kunzeb5fabec2022-06-07 05:20:44 +000031 OpEqual(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_)
32 : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_EQUAL, id_)
Eric Kunzee5e26762020-10-13 16:11:07 -070033 {
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
41template <int Rank, DType Dtype>
42class OpGreater : public BinaryNode<Rank, Dtype, DType_BOOL>
43{
44public:
Eric Kunzeb5fabec2022-06-07 05:20:44 +000045 OpGreater(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_)
46 : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_GREATER, id_)
Eric Kunzee5e26762020-10-13 16:11:07 -070047 {
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
55template <int Rank, DType Dtype>
56class OpGreaterEqual : public BinaryNode<Rank, Dtype, DType_BOOL>
57{
58public:
Eric Kunzeb5fabec2022-06-07 05:20:44 +000059 OpGreaterEqual(SubgraphTraverser* sgt_, TosaAttributeBase* attribute_, uint64_t id_)
60 : BinaryNode<Rank, Dtype, DType_BOOL>(sgt_, Op_EQUAL, id_)
Eric Kunzee5e26762020-10-13 16:11:07 -070061 {
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