Commit 5d8e93f6 authored by zhanghj2's avatar zhanghj2
Browse files

判断是否为正无穷

parent 50f07abd
...@@ -347,5 +347,19 @@ __forceinline__ __device__ auto convert_layout_acc_Aregs(const TiledMma& tiled_m ...@@ -347,5 +347,19 @@ __forceinline__ __device__ auto convert_layout_acc_Aregs(const TiledMma& tiled_m
return tSrACC; return tSrACC;
} }
__forceinline__ __device__ bool
is_positive_infinity(const float& f_val)
{
union Fp32{
uint32_t as_bits;
float as_value;
};
Fp32 fp32;
fp32.as_value = f_val;
Fp32 inf_tmp;
inf_tmp.as_value = INFINITY;
return fp32.as_bits == inf_tmp.as_bits;
}
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment