Coverage for src/flag_gems/ops/isneginf.py: 88%

17 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2026-05-26 06:59 +0800

1import logging 

2 

3import triton 

4 

5from flag_gems.utils import pointwise_dynamic 

6 

7logger = logging.getLogger(__name__) 

8 

9 

10@pointwise_dynamic(promotion_methods=[(0, "ALWAYS_BOOL")]) 

11@triton.jit 

12def isneginf_func(x): 

13 return x == float("-inf") 

14 

15 

16def isneginf(A): 

17 logger.debug("GEMS ISNEGINF") 

18 return isneginf_func(A) 

19 

20 

21def isneginf_out(A, *, out=None): 

22 logger.debug("GEMS ISNEGINF_OUT") 

23 if out is None: 

24 return isneginf_func(A) 

25 isneginf_func(A, out0=out) 

26 return out