Fix warning 186-D from nvcc

This commit is contained in:
Cheng 2025-08-21 17:55:07 -07:00
parent 9392fc3f88
commit f3d58b3aaf

View File

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