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

19 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2026-03-11 02:28 +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 lt_func(x, y): 

14 return x.to(tl.float32) < y 

15 

16 

17def lt(A, B): 

18 logger.debug("GEMS LT") 

19 return lt_func(A, B) 

20 

21 

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

23@triton.jit 

24def lt_func_scalar(x, y): 

25 return x.to(tl.float32) < y 

26 

27 

28def lt_scalar(A, B): 

29 logger.debug("GEMS LT SCALAR") 

30 return lt_func_scalar(A, B)