Skip to content

Commit d3f6fe1

Browse files
Chao1Hangujinghui
andauthored
UT FIX: type promotion issue (#2541) (#2547)
* UT FIX: type promotion issue * fix copysign --------- Co-authored-by: Jinghui <jinghui.gu@intel.com>
1 parent 4f0598b commit d3f6fe1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

csrc/gpu/aten/operators/BinaryOps_trig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void atan2_kernel(TensorIterator& iter) {
5151
IPEX_DISPATCH_FLOATING_TYPES_AND2(
5252
at::ScalarType::BFloat16,
5353
at::ScalarType::Half,
54-
iter.dtype(),
54+
iter.common_dtype(),
5555
"atan2",
5656
[&]() {
5757
dpcpp_kernel_for_tensor_iter(

csrc/gpu/aten/operators/GcdLcm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ namespace AtenIpexTypeXPU {
1717
namespace impl {
1818

1919
static void gcd_kernel_dpcpp(TensorIterator& iter) {
20-
IPEX_DISPATCH_INTEGRAL_TYPES(iter.dtype(), "gcd", [&]() {
20+
IPEX_DISPATCH_INTEGRAL_TYPES(iter.common_dtype(), "gcd", [&]() {
2121
dpcpp_fast_mode_kernel_with_scalars(
2222
iter,
2323
[=](scalar_t a, scalar_t b) -> scalar_t { return calc_gcd(a, b); });
2424
});
2525
}
2626

2727
static void lcm_kernel_dpcpp(TensorIterator& iter) {
28-
IPEX_DISPATCH_INTEGRAL_TYPES(iter.dtype(), "lcm", [&]() {
28+
IPEX_DISPATCH_INTEGRAL_TYPES(iter.common_dtype(), "lcm", [&]() {
2929
dpcpp_fast_mode_kernel_with_scalars(
3030
iter, [=](scalar_t a, scalar_t b) -> scalar_t {
3131
scalar_t g = calc_gcd(a, b);

csrc/gpu/aten/operators/comm/LoopsMeta.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ namespace AtenIpexTypeXPU {
157157
IPEX_DISPATCH_##types##_AND2( \
158158
at::ScalarType::Half, \
159159
at::ScalarType::BFloat16, \
160-
iter.dtype(), \
160+
iter.common_dtype(), \
161161
#op, \
162162
[&]() { \
163163
dpcpp_kernel_with_scalars( \

0 commit comments

Comments
 (0)