File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,11 @@ REGISTER_COMPARE_OP(less_than, "Out = X < Y");
100
100
REGISTER_COMPARE_KERNEL (less_than, CPU, paddle::operators::LessThanFunctor);
101
101
REGISTER_COMPARE_OP (less_equal, " Out = X <= Y" );
102
102
REGISTER_COMPARE_KERNEL (less_equal, CPU, paddle::operators::LessEqualFunctor);
103
+ REGISTER_COMPARE_OP (larger_than, " Out = X > Y" );
104
+ REGISTER_COMPARE_KERNEL (larger_than, CPU, paddle::operators::LargerThanFunctor);
105
+ REGISTER_COMPARE_OP (larger_equal, " Out = X >= Y" );
106
+ REGISTER_COMPARE_KERNEL (larger_equal, CPU,
107
+ paddle::operators::LargerEqualFunctor);
103
108
REGISTER_COMPARE_OP (equal, " Out = X == Y" );
104
109
REGISTER_COMPARE_KERNEL (equal, CPU, paddle::operators::EqualFunctor);
105
110
REGISTER_COMPARE_OP (not_equal, " Out = X != Y" );
Original file line number Diff line number Diff line change @@ -16,5 +16,9 @@ limitations under the License. */
16
16
17
17
REGISTER_COMPARE_KERNEL (less_than, CUDA, paddle::operators::LessThanFunctor);
18
18
REGISTER_COMPARE_KERNEL (less_equal, CUDA, paddle::operators::LessEqualFunctor);
19
+ REGISTER_COMPARE_KERNEL (larger_than, CUDA,
20
+ paddle::operators::LargerThanFunctor);
21
+ REGISTER_COMPARE_KERNEL (larger_equal, CUDA,
22
+ paddle::operators::LargerEqualFunctor);
19
23
REGISTER_COMPARE_KERNEL (equal, CUDA, paddle::operators::EqualFunctor);
20
24
REGISTER_COMPARE_KERNEL (not_equal, CUDA, paddle::operators::NotEqualFunctor);
Original file line number Diff line number Diff line change @@ -34,6 +34,18 @@ struct LessEqualFunctor {
34
34
HOSTDEVICE bool operator ()(const T& a, const T& b) const { return a <= b; }
35
35
};
36
36
37
+ template <typename T>
38
+ struct LargerThanFunctor {
39
+ using ELEM_TYPE = T;
40
+ HOSTDEVICE bool operator ()(const T& a, const T& b) const { return a > b; }
41
+ };
42
+
43
+ template <typename T>
44
+ struct LargerEqualFunctor {
45
+ using ELEM_TYPE = T;
46
+ HOSTDEVICE bool operator ()(const T& a, const T& b) const { return a >= b; }
47
+ };
48
+
37
49
template <typename T>
38
50
struct EqualFunctor {
39
51
using ELEM_TYPE = T;
You can’t perform that action at this time.
0 commit comments