Coverage for src/flag_gems/runtime/backend/_kunlunxin/ops/bitwise_not.py: 0%
17 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-10 02:30 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-10 02:30 +0800
1import logging
3import triton
4from _kunlunxin.utils.codegen_config_utils import CodeGenConfig
6from ..utils.pointwise_dynamic import pointwise_dynamic
8logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))
10config_ = CodeGenConfig(
11 512,
12 (65536, 65536, 65536),
13 32,
14 True,
15 prefer_1d_tile=True,
16 isCloseMemoryAsync=False,
17 kunlunAutoGrid=True,
18 unroll_num=8,
19)
22@pointwise_dynamic(promotion_methods=[(0, "DEFAULT")], config=config_)
23@triton.jit
24def bitwise_not_func(x):
25 return ~x
28def bitwise_not(A):
29 logger.debug("GEMS BITWISE NOT")
30 return bitwise_not_func(A)
33def bitwise_not_(A):
34 logger.debug("GEMS BITWISE NOT_")
35 bitwise_not_func(A, out0=A)
36 return A