Coverage for src/flag_gems/runtime/backend/_cambricon/ops/bitwise_not.py: 0%

15 statements  

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

1import logging 

2 

3import triton 

4 

5from ..utils.pointwise_dynamic import pointwise_dynamic 

6 

7logger = logging.getLogger("flag_gems").getChild(__name__.lstrip(".")) 

8 

9 

10@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, "DEFAULT")]) 

11@triton.jit 

12def bitwise_not_func(x, inplace): 

13 return ~x 

14 

15 

16def bitwise_not(A): 

17 logger.debug("GEMS_CAMBRICON BITWISE NOT") 

18 return bitwise_not_func(A, False) 

19 

20 

21def bitwise_not_(A): 

22 logger.debug("GEMS_CAMBRICON BITWISE NOT_") 

23 bitwise_not_func(A, True, out0=A) 

24 return A