Coverage for src/flag_gems/runtime/backend/_sunrise/ops/ge.py: 0%

22 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2026-06-10 07:09 +0800

1import logging 

2 

3import triton 

4import triton.language as tl 

5 

6from flag_gems.utils import pointwise_dynamic 

7from flag_gems.utils.pointwise_dynamic import CodeGenConfig 

8 

9logger = logging.getLogger(__name__) 

10 

11MAX_GRID_SIZES = (65535, 65535, 65535) 

12config = CodeGenConfig( 

13 max_tile_size=512, 

14 max_grid_size=MAX_GRID_SIZES, 

15 max_num_warps_per_cta=32, 

16 prefer_block_pointer=True, 

17 prefer_1d_tile=True, 

18) 

19 

20 

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

22@triton.jit 

23def ge_func(x, y): 

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

25 

26 

27def ge(A, B): 

28 logger.debug("GEMS GE") 

29 return ge_func(A, B) 

30 

31 

32@pointwise_dynamic( 

33 is_tensor=[True, False], promotion_methods=[(0, 1, "ALWAYS_BOOL")], config=config 

34) 

35@triton.jit 

36def ge_func_scalar(x, y): 

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

38 

39 

40def ge_scalar(A, B): 

41 logger.debug("GEMS GE SCALAR") 

42 return ge_func_scalar(A, B)