From f3d58b3aaf2edd552d1107b4f92d862fc0e6b56b Mon Sep 17 00:00:00 2001 From: Cheng Date: Thu, 21 Aug 2025 17:55:07 -0700 Subject: [PATCH] Fix warning 186-D from nvcc --- mlx/backend/cuda/device/binary_ops.cuh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mlx/backend/cuda/device/binary_ops.cuh b/mlx/backend/cuda/device/binary_ops.cuh index 31daf34cb..1ff22cff8 100644 --- a/mlx/backend/cuda/device/binary_ops.cuh +++ b/mlx/backend/cuda/device/binary_ops.cuh @@ -205,8 +205,10 @@ struct Power { if constexpr (cuda::std::is_integral_v) { T res = 1; // Raising an integer to a negative power is undefined - if (exp < 0) { - return 0; + if constexpr (cuda::std::is_signed_v) { + if (exp < 0) { + return 0; + } } while (exp) { if (exp & 1) {