Coverage for src/flag_gems/ops/logical_xor.py: 92%

12 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 logical_xor_func(x, y): 

14 return x.to(tl.int1) ^ y.to(tl.int1) 

15 

16 

17def logical_xor(A, B): 

18 logger.debug("GEMS LOGICAL_XOR") 

19 return logical_xor_func(A, B)