Fix warning 186-D from nvcc (#2527)

This commit is contained in:
Cheng 2025-08-22 10:29:55 +09:00 committed by GitHub
parent f93f87c802
commit f6819a1f26
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -205,9 +205,11 @@ struct Power {
if constexpr (cuda::std::is_integral_v<T>) {
T res = 1;
// Raising an integer to a negative power is undefined
if constexpr (cuda::std::is_signed_v<T>) {
if (exp < 0) {
return 0;
}
}
while (exp) {
if (exp & 1) {
res *= base;