Coverage for src/flag_gems/runtime/backend/_cambricon/ops/bitwise_and.py: 0%
27 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-18 02:36 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-18 02:36 +0800
1import logging
3import triton
5from ..utils.pointwise_dynamic import pointwise_dynamic
7logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))
10@pointwise_dynamic(is_tensor=[True, True, False], promotion_methods=[(0, 1, "DEFAULT")])
11@triton.jit
12def bitwise_and_func(x, y, inplace):
13 return x & y
16def bitwise_and_tensor(A, B):
17 logger.debug("GEMS_CAMBRICON BITWISE AND")
18 return bitwise_and_func(A, B, False)
21def bitwise_and_tensor_(A, B):
22 logger.debug("GEMS_CAMBRICON AND_")
23 return bitwise_and_func(A, B, True, out0=A)
26@pointwise_dynamic(
27 is_tensor=[True, False, False], promotion_methods=[(0, 1, "DEFAULT")]
28)
29@triton.jit
30def bitwise_and_func_scalar(x, y, inplace):
31 return x & y
34def bitwise_and_scalar(A, B):
35 logger.debug("GEMS_CAMBRICON BITWISE AND SCALAR")
36 return bitwise_and_func_scalar(A, B, False)
39def bitwise_and_scalar_(A, B):
40 logger.debug("GEMS_CAMBRICON BITWISE AND_ SCALAR")
41 return bitwise_and_func_scalar(A, B, True, out0=A)
44def bitwise_and_scalar_tensor(A, B):
45 logger.debug("GEMS_CAMBRICON BITWISE AND SCALAR TENSOR")
46 return bitwise_and_func_scalar(B, A, False)