Skip to content

Commit 8fbbdee

Browse files
committed
Update
[ghstack-poisoned]
1 parent 5bc4b0c commit 8fbbdee

File tree

12 files changed

+63
-75
lines changed

12 files changed

+63
-75
lines changed

.lintrunner.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,13 @@ exclude_patterns = [
220220
'extension/**',
221221
'kernels/optimized/**',
222222
# Justified <functional> include.
223+
'kernels/portable/cpu/op_bitwise*.cpp',
224+
'kernels/portable/cpu/op_eq.cpp',
225+
'kernels/portable/cpu/op_ge.cpp',
226+
'kernels/portable/cpu/op_gt.cpp',
227+
'kernels/portable/cpu/op_le.cpp',
228+
'kernels/portable/cpu/op_lt.cpp',
229+
'kernels/portable/cpu/op_ne.cpp',
223230
'runtime/kernel/thread_parallel_interface.h',
224231
'scripts/**',
225232
'third-party/**',

kernels/portable/cpu/op_bitwise_and.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/bitwise_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,7 @@ Tensor& bitwise_and_Tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "bitwise_and.Tensor_out";
22-
return internal::bitwise_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::bitwise_tensor_out<std::bit_and, op_name>(ctx, a, b, out);
2325
}
2426

2527
Tensor& bitwise_and_Scalar_out(
@@ -29,7 +31,7 @@ Tensor& bitwise_and_Scalar_out(
2931
Tensor& out) {
3032
// @lint-ignore CLANGTIDY facebook-hte-CArray
3133
static constexpr const char op_name[] = "bitwise_and.Scalar_out";
32-
return internal::bitwise_scalar_out<op_name>(ctx, a, b, out);
34+
return internal::bitwise_scalar_out<std::bit_and, op_name>(ctx, a, b, out);
3335
}
3436

3537
} // namespace native

kernels/portable/cpu/op_bitwise_or.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/bitwise_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,7 @@ Tensor& bitwise_or_Tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "bitwise_or.Tensor_out";
22-
return internal::bitwise_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::bitwise_tensor_out<std::bit_or, op_name>(ctx, a, b, out);
2325
}
2426

2527
Tensor& bitwise_or_Scalar_out(
@@ -29,7 +31,7 @@ Tensor& bitwise_or_Scalar_out(
2931
Tensor& out) {
3032
// @lint-ignore CLANGTIDY facebook-hte-CArray
3133
static constexpr const char op_name[] = "bitwise_or.Scalar_out";
32-
return internal::bitwise_scalar_out<op_name>(ctx, a, b, out);
34+
return internal::bitwise_scalar_out<std::bit_or, op_name>(ctx, a, b, out);
3335
}
3436

3537
} // namespace native

kernels/portable/cpu/op_bitwise_xor.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/bitwise_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,7 @@ Tensor& bitwise_xor_Tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "bitwise_xor.Tensor_out";
22-
return internal::bitwise_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::bitwise_tensor_out<std::bit_xor, op_name>(ctx, a, b, out);
2325
}
2426

2527
Tensor& bitwise_xor_Scalar_out(
@@ -29,7 +31,7 @@ Tensor& bitwise_xor_Scalar_out(
2931
Tensor& out) {
3032
// @lint-ignore CLANGTIDY facebook-hte-CArray
3133
static constexpr const char op_name[] = "bitwise_xor.Scalar_out";
32-
return internal::bitwise_scalar_out<op_name>(ctx, a, b, out);
34+
return internal::bitwise_scalar_out<std::bit_xor, op_name>(ctx, a, b, out);
3335
}
3436

3537
} // namespace native

kernels/portable/cpu/op_eq.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/comparison_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,8 @@ Tensor& eq_tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "eq.Tensor_out";
22-
return internal::comparison_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::comparison_tensor_out<std::equal_to, op_name>(
25+
ctx, a, b, out);
2326
}
2427

2528
Tensor& eq_scalar_out(
@@ -29,7 +32,8 @@ Tensor& eq_scalar_out(
2932
Tensor& out) {
3033
// @lint-ignore CLANGTIDY facebook-hte-CArray
3134
static constexpr const char op_name[] = "eq.Scalar_out";
32-
return internal::comparison_scalar_out<op_name>(ctx, a, b, out);
35+
return internal::comparison_scalar_out<std::equal_to, op_name>(
36+
ctx, a, b, out);
3337
}
3438

3539
} // namespace native

kernels/portable/cpu/op_ge.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/comparison_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,8 @@ Tensor& ge_tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "ge.Tensor_out";
22-
return internal::comparison_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::comparison_tensor_out<std::greater_equal, op_name>(
25+
ctx, a, b, out);
2326
}
2427

2528
Tensor& ge_scalar_out(
@@ -29,7 +32,8 @@ Tensor& ge_scalar_out(
2932
Tensor& out) {
3033
// @lint-ignore CLANGTIDY facebook-hte-CArray
3134
static constexpr const char op_name[] = "ge.Scalar_out";
32-
return internal::comparison_scalar_out<op_name>(ctx, a, b, out);
35+
return internal::comparison_scalar_out<std::greater_equal, op_name>(
36+
ctx, a, b, out);
3337
}
3438

3539
} // namespace native

kernels/portable/cpu/op_gt.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/comparison_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,7 @@ Tensor& gt_tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "gt.Tensor_out";
22-
return internal::comparison_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::comparison_tensor_out<std::greater, op_name>(ctx, a, b, out);
2325
}
2426

2527
Tensor& gt_scalar_out(
@@ -29,7 +31,7 @@ Tensor& gt_scalar_out(
2931
Tensor& out) {
3032
// @lint-ignore CLANGTIDY facebook-hte-CArray
3133
static constexpr const char op_name[] = "gt.Scalar_out";
32-
return internal::comparison_scalar_out<op_name>(ctx, a, b, out);
34+
return internal::comparison_scalar_out<std::greater, op_name>(ctx, a, b, out);
3335
}
3436

3537
} // namespace native

kernels/portable/cpu/op_le.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/comparison_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,8 @@ Tensor& le_tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "le.Tensor_out";
22-
return internal::comparison_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::comparison_tensor_out<std::less_equal, op_name>(
25+
ctx, a, b, out);
2326
}
2427

2528
Tensor& le_scalar_out(
@@ -29,7 +32,8 @@ Tensor& le_scalar_out(
2932
Tensor& out) {
3033
// @lint-ignore CLANGTIDY facebook-hte-CArray
3134
static constexpr const char op_name[] = "le.Scalar_out";
32-
return internal::comparison_scalar_out<op_name>(ctx, a, b, out);
35+
return internal::comparison_scalar_out<std::less_equal, op_name>(
36+
ctx, a, b, out);
3337
}
3438

3539
} // namespace native

kernels/portable/cpu/op_lt.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/comparison_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,7 @@ Tensor& lt_tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "lt.Tensor_out";
22-
return internal::comparison_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::comparison_tensor_out<std::less, op_name>(ctx, a, b, out);
2325
}
2426

2527
Tensor& lt_scalar_out(
@@ -29,7 +31,7 @@ Tensor& lt_scalar_out(
2931
Tensor& out) {
3032
// @lint-ignore CLANGTIDY facebook-hte-CArray
3133
static constexpr const char op_name[] = "lt.Scalar_out";
32-
return internal::comparison_scalar_out<op_name>(ctx, a, b, out);
34+
return internal::comparison_scalar_out<std::less, op_name>(ctx, a, b, out);
3335
}
3436

3537
} // namespace native

kernels/portable/cpu/op_ne.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <executorch/kernels/portable/cpu/pattern/comparison_op.h>
1010

11+
#include <functional>
12+
1113
namespace torch {
1214
namespace executor {
1315
namespace native {
@@ -19,7 +21,8 @@ Tensor& ne_tensor_out(
1921
Tensor& out) {
2022
// @lint-ignore CLANGTIDY facebook-hte-CArray
2123
static constexpr const char op_name[] = "ne.Tensor_out";
22-
return internal::comparison_tensor_out<op_name>(ctx, a, b, out);
24+
return internal::comparison_tensor_out<std::not_equal_to, op_name>(
25+
ctx, a, b, out);
2326
}
2427

2528
Tensor& ne_scalar_out(
@@ -29,7 +32,8 @@ Tensor& ne_scalar_out(
2932
Tensor& out) {
3033
// @lint-ignore CLANGTIDY facebook-hte-CArray
3134
static constexpr const char op_name[] = "ne.Scalar_out";
32-
return internal::comparison_scalar_out<op_name>(ctx, a, b, out);
35+
return internal::comparison_scalar_out<std::not_equal_to, op_name>(
36+
ctx, a, b, out);
3337
}
3438

3539
} // namespace native

0 commit comments

Comments
 (0)