Coverage for src/flag_gems/ops/bitwise_not.py: 93%

15 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2026-03-13 10:08 +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, "DEFAULT")]) 

11@triton.jit 

12def bitwise_not_func(x): 

13 return ~x 

14 

15 

16def bitwise_not(A): 

17 logger.debug("GEMS BITWISE NOT") 

18 return bitwise_not_func(A) 

19 

20 

21def bitwise_not_(A): 

22 logger.debug("GEMS BITWISE NOT_") 

23 bitwise_not_func(A, out0=A) 

24 return A