Skip to content

Commit 7d6ca43

Browse files
committed
Revert "Implement unary_ufunc functions using elementwise_util (#9386)"
This reverts commit dffbd42.
1 parent 120eb85 commit 7d6ca43

35 files changed

+251
-222
lines changed

kernels/portable/cpu/op_acos.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& acos_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "acos.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::acos(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::acos, ctx, in, out);
2120
}
2221

2322
} // namespace native

kernels/portable/cpu/op_acosh.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& acosh_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "acosh.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::acosh(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::acosh, ctx, in, out);
2120
}
2221

2322
} // namespace native

kernels/portable/cpu/op_asin.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& asin_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "asin.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::asin(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::asin, ctx, in, out);
2120
}
2221

2322
} // namespace native

kernels/portable/cpu/op_asinh.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& asinh_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "asinh.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::asinh(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::asinh, ctx, in, out);
2120
}
2221

2322
} // namespace native

kernels/portable/cpu/op_atan.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& atan_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "atan.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::atan(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::atan, ctx, in, out);
2120
}
2221

2322
} // namespace native

kernels/portable/cpu/op_atanh.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& atanh_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "atanh.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::atanh(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::atanh, ctx, in, out);
2120
}
2221

2322
} // namespace native

kernels/portable/cpu/op_ceil.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ namespace native {
1717
using executorch::aten::Tensor;
1818

1919
Tensor& ceil_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
20-
static constexpr const char op_name[] = "ceil.out";
21-
return internal::unary_ufunc_realhbf16<op_name>(
22-
[](auto x) { return executorch::math::ceil(x); }, ctx, in, out);
20+
return internal::unary_ufunc_realhbf16(std::ceil, ctx, in, out);
2321
}
2422

2523
} // namespace native

kernels/portable/cpu/op_cos.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& cos_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "cos.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::cos(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(std::cos, ctx, in, out);
2119
}
2220

2321
} // namespace native

kernels/portable/cpu/op_cosh.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& cosh_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "cosh.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::cosh(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::cosh, ctx, in, out);
2120
}
2221

2322
} // namespace native

kernels/portable/cpu/op_erf.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& erf_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
static constexpr const char op_name[] = "erf.out";
19-
return internal::unary_ufunc_realhbbf16_to_floathbf16<op_name>(
20-
[](auto x) { return executorch::math::erf(x); }, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(std::erf, ctx, in, out);
2119
}
2220

2321
} // namespace native

0 commit comments

Comments
 (0)