From d07b19e4df981ea95469f89b15497846d850e006 Mon Sep 17 00:00:00 2001 From: Zihao Ye Date: Tue, 13 Aug 2024 09:40:50 -0700 Subject: [PATCH] bugfix: suppress warning #63-D: shift count is too large (#444) Followup of #439 , use `constexpr` in if conditions so that `BIAS_OFFSET` won't exceed 32 at compile time. --- include/flashinfer/vec_dtypes.cuh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/flashinfer/vec_dtypes.cuh b/include/flashinfer/vec_dtypes.cuh index 38719b43..596763c1 100644 --- a/include/flashinfer/vec_dtypes.cuh +++ b/include/flashinfer/vec_dtypes.cuh @@ -135,7 +135,7 @@ __device__ void fast_dequant_f8f16x4(uint32_t* input, uint2* output) { constexpr int BIAS_OFFSET = (1 << (FP16_EXPONENT - 1)) - (1 << (FP8_EXPONENT - 1)); // Construct and apply exponent bias - if (std::is_same::value) { + if constexpr (std::is_same::value) { const half2 bias_reg = __float2half2_rn(float(1 << BIAS_OFFSET)); // Convert to half2 and apply bias