Skip to content

Commit 6a27589

Browse files
swolchokfacebook-github-bot
authored andcommitted
s/unary_ufunc_realhb_to_floath/unary_ufunc_realhbbf16_to_floathbf16/ (#5678)
Summary: Pull Request resolved: pytorch/executorch#5678 This function can be trivially extended to support bfloat16. ghstack-source-id: 245578278 exported-using-ghexport Reviewed By: mergennachin Differential Revision: D63438654 fbshipit-source-id: 875a9a3baf3b1b002b2b239edcc00cc868f7688f
1 parent 085b817 commit 6a27589

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+197
-141
lines changed

kernels/portable/cpu/op_acos.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& acos_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::acos, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::acos, ctx, in, out);
1920
}
2021

2122
} // namespace native

kernels/portable/cpu/op_acosh.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& acosh_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::acosh, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::acosh, ctx, in, out);
1920
}
2021

2122
} // namespace native

kernels/portable/cpu/op_asin.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& asin_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::asin, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::asin, ctx, in, out);
1920
}
2021

2122
} // namespace native

kernels/portable/cpu/op_asinh.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& asinh_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::asinh, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::asinh, ctx, in, out);
1920
}
2021

2122
} // namespace native

kernels/portable/cpu/op_atan.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& atan_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::atan, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::atan, ctx, in, out);
1920
}
2021

2122
} // namespace native

kernels/portable/cpu/op_atanh.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& atanh_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::atanh, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::atanh, ctx, in, out);
1920
}
2021

2122
} // namespace native

kernels/portable/cpu/op_cos.cpp

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

1717
Tensor& cos_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::cos, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(std::cos, ctx, in, out);
1919
}
2020

2121
} // namespace native

kernels/portable/cpu/op_cosh.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ namespace executor {
1515
namespace native {
1616

1717
Tensor& cosh_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::cosh, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(
19+
std::cosh, ctx, in, out);
1920
}
2021

2122
} // namespace native

kernels/portable/cpu/op_erf.cpp

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

1717
Tensor& erf_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::erf, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(std::erf, ctx, in, out);
1919
}
2020

2121
} // namespace native

kernels/portable/cpu/op_exp.cpp

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

1717
Tensor& exp_out(KernelRuntimeContext& ctx, const Tensor& in, Tensor& out) {
18-
return internal::unary_ufunc_realhb_to_floath(std::exp, ctx, in, out);
18+
return internal::unary_ufunc_realhbbf16_to_floathbf16(std::exp, ctx, in, out);
1919
}
2020

2121
} // namespace native

0 commit comments

Comments
 (0)