Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/ATen/native/xpu/sycl/HermitePolynomialHKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ namespace at::native::xpu {
template <typename scalar_t>
struct HermitePolynomialHFunctor {
scalar_t operator()(scalar_t x, scalar_t n_) const {
int64_t n = static_cast<int64_t>(n_);
auto n = static_cast<int64_t>(n_);
if (n < 0) {
return scalar_t(0.0);
}

if (n == 0) {
} else if (n == 0) {
return scalar_t(1.0);
}

if (n == 1) {
} else if (n == 1) {
return x + x;
} else if (n > getHermitianLimit<scalar_t>()) {
return std::numeric_limits<scalar_t>::quiet_NaN();
}

scalar_t p = scalar_t(1.0);
Expand Down
12 changes: 5 additions & 7 deletions src/ATen/native/xpu/sycl/HermitePolynomialHeKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ namespace at::native::xpu {
template <typename scalar_t>
struct HermitePolynomialHeFunctor {
scalar_t operator()(scalar_t x, scalar_t n_) const {
int64_t n = static_cast<int64_t>(n_);
auto n = static_cast<int64_t>(n_);
if (n < 0) {
return scalar_t(0.0);
}

if (n == 0) {
} else if (n == 0) {
return scalar_t(1.0);
}

if (n == 1) {
} else if (n == 1) {
return x;
} else if (n > getHermitianLimit<scalar_t>()) {
return std::numeric_limits<scalar_t>::quiet_NaN();
}

scalar_t p = scalar_t(1.0);
Expand Down
2 changes: 1 addition & 1 deletion src/ATen/native/xpu/sycl/LaguerrePolynomialLKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct LaguerrePolynomialLFunctor {
scalar_t q = scalar_t(1.0) - x;
scalar_t r;

for (int64_t k = 1; k < n; k++) {
for (int64_t k = 1; (k < n) && !std::isnan(q); k++) {
r = (((k + k) + (scalar_t(1.0) - x)) * q - k * p) / (k + 1);
p = q;
q = r;
Expand Down
2 changes: 1 addition & 1 deletion src/ATen/native/xpu/sycl/LegendrePolynomialPKernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct LegendrePolynomialPFunctor {
scalar_t q = x;
scalar_t r;

for (int64_t k = 1; k < n; k++) {
for (int64_t k = 1; (k < n) && !std::isnan(q); k++) {
r = ((k + k + 1) * x * q - k * p) / (k + 1);
p = q;
q = r;
Expand Down
6 changes: 0 additions & 6 deletions test/xpu/skip_list_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@
"test_compare_cpu_linalg_lu_factor_ex_xpu_float32",
"test_compare_cpu_linalg_lu_factor_xpu_float32",
"test_compare_cpu_linalg_lu_xpu_float32",
# XPU hang. CUDA hang as well.
# https://github.com/pytorch/pytorch/issues/79528
"test_compare_cpu_special_hermite_polynomial_he_xpu_float32",
"test_compare_cpu_special_hermite_polynomial_h_xpu_float32",
"test_compare_cpu_special_laguerre_polynomial_l_xpu_float32",
"test_compare_cpu_special_legendre_polynomial_p_xpu_float32",
# core dump
"test_dtypes__refs_nn_functional_pdist_xpu",
# XFAIL of CUDA and XPU, unexpected success in fallback
Expand Down