Coverage for src/flag_gems/ops/ge.py: 89%

19 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2026-03-25 02:48 +0800

1import logging 

2 

3import triton 

4import triton.language as tl 

5 

6from flag_gems.utils import pointwise_dynamic 

7 

8logger = logging.getLogger(__name__) 

9 

10 

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

12@triton.jit 

13def ge_func(x, y): 

14 return x.to(tl.float32) >= y 

15 

16 

17def ge(A, B): 

18 logger.debug("GEMS GE") 

19 return ge_func(A, B) 

20 

21 

22@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, 1, "ALWAYS_BOOL")]) 

23@triton.jit 

24def ge_func_scalar(x, y): 

25 return x.to(tl.float32) >= y 

26 

27 

28def ge_scalar(A, B): 

29 logger.debug("GEMS GE SCALAR") 

30 return ge_func_scalar(A, B)