diff --git a/cub/cub/detail/fast_modulo_division.cuh b/cub/cub/detail/fast_modulo_division.cuh index d58a940abc9..2ae65400e71 100644 --- a/cub/cub/detail/fast_modulo_division.cuh +++ b/cub/cub/detail/fast_modulo_division.cuh @@ -111,8 +111,14 @@ multiply_extract_higher_bits(T value, R multiplier) static_assert(supported_integral::value, "unsupported type"); _CCCL_DIAG_PUSH _CCCL_DIAG_SUPPRESS_ICC(186) // pointless comparison of unsigned integer with zero - _CCCL_ASSERT(value >= 0, "value must be non-negative"); - _CCCL_ASSERT(multiplier >= 0, "multiplier must be non-negative"); + _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(::cuda::std::is_signed, T)) + { + _CCCL_ASSERT(value >= 0, "value must be non-negative"); + } + _CCCL_IF_CONSTEXPR (_CCCL_TRAIT(::cuda::std::is_signed, R)) + { + _CCCL_ASSERT(multiplier >= 0, "multiplier must be non-negative"); + } _CCCL_DIAG_POP static constexpr int NumBits = sizeof(DivisorType) * CHAR_BIT; using unsigned_t = unsigned_implicit_prom_t;