|
3 | 3 | #include <ATen/AccumulateType.h>
|
4 | 4 | #include <ATen/NumericUtils.h>
|
5 | 5 | #include <ATen/jiterator_macros.h>
|
| 6 | +#include <c10/macros/Macros.h> |
6 | 7 | #include <c10/util/BFloat16.h>
|
7 | 8 | #include <c10/util/Half.h>
|
8 | 9 | #include <c10/util/MathConstants.h>
|
@@ -3071,14 +3072,14 @@ inline C10_HOST_DEVICE T hermite_polynomial_h_forward(T x, int64_t n) {
|
3071 | 3072 | return r;
|
3072 | 3073 | } // hermite_polynomial_h_forward(T x, int64_t n)
|
3073 | 3074 |
|
3074 |
| -template<typename T, bool is_cuda=false, std::enable_if_t<!std::is_floating_point<T>::value, int> = 0> |
| 3075 | +template<typename T, bool is_cuda=false, std::enable_if_t<!std::is_floating_point_v<T>, int> = 0> |
3075 | 3076 | inline C10_HOST_DEVICE T hermite_polynomial_h_forward(T x, T n) {
|
3076 | 3077 | return hermite_polynomial_h_forward(x, static_cast<int64_t>(n));
|
3077 | 3078 | } // hermite_polynomial_h_forward(T x, T n)
|
3078 | 3079 |
|
3079 |
| -template<typename T, bool is_cuda=false, std::enable_if_t<std::is_floating_point<T>::value, int> = 0> |
3080 |
| -inline C10_HOST_DEVICE T hermite_polynomial_h_forward(T x, T n) { |
3081 |
| - return hermite_polynomial_h_forward(x, ((!std::isinf(n)) && (!std::isnan(n))) ? static_cast<int64_t>(n) : static_cast<int64_t>(-1)); |
| 3080 | +template<typename T, bool is_cuda=false, std::enable_if_t<std::is_floating_point_v<T>, int> = 0> |
| 3081 | +__ubsan_ignore_float_cast_overflow__ inline C10_HOST_DEVICE T hermite_polynomial_h_forward(T x, T n) { |
| 3082 | + return hermite_polynomial_h_forward(x, (!std::isinf(n) && !std::isnan(n)) ? static_cast<int64_t>(n) : static_cast<int64_t>(-1)); |
3082 | 3083 | } // hermite_polynomial_h_forward(T x, T n)
|
3083 | 3084 |
|
3084 | 3085 | template<typename T>
|
|
0 commit comments