Coverage for src/flag_gems/runtime/backend/_kunlunxin/ops/isnan.py: 0%
14 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-05-26 06:59 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-05-26 06:59 +0800
1import logging
3import triton
4import triton.language as tl
6from flag_gems.utils import tl_extra_shim
8from ..utils.pointwise_dynamic import pointwise_dynamic
10logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))
11_isnan = tl_extra_shim.isnan
14@pointwise_dynamic(promotion_methods=[(0, "ALWAYS_BOOL")])
15@triton.jit
16def isnan_func(x):
17 # Convert to float32 for consistent NaN detection across dtypes
18 return _isnan(x.to(tl.float32))
21def isnan(A):
22 logger.debug("GEMS_KUNLUNXIN ISNAN")
23 return isnan_func(A)