Skip to content

Commit

Permalink
bugfix: suppress warning #63-D: shift count is too large (#444)
Browse files Browse the repository at this point in the history
Followup of #439 , use `constexpr` in if conditions so that
`BIAS_OFFSET` won't exceed 32 at compile time.
  • Loading branch information
yzh119 authored Aug 13, 2024
1 parent 7470edc commit d07b19e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/flashinfer/vec_dtypes.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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<fp16_dtype, half>::value) {
if constexpr (std::is_same<fp16_dtype, half>::value) {
const half2 bias_reg = __float2half2_rn(float(1 << BIAS_OFFSET));

// Convert to half2 and apply bias
Expand Down

0 comments on commit d07b19e

Please sign in to comment.