Coverage for src/flag_gems/ops/bitwise_and.py: 93%
27 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-25 02:48 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-25 02:48 +0800
1import logging
3import triton
5from flag_gems.utils import pointwise_dynamic
7logger = logging.getLogger(__name__)
10@pointwise_dynamic(promotion_methods=[(0, 1, "DEFAULT")])
11@triton.jit
12def bitwise_and_func(x, y):
13 return x & y
16def bitwise_and_tensor(A, B):
17 logger.debug("GEMS BITWISE AND")
18 return bitwise_and_func(A, B)
21def bitwise_and_tensor_(A, B):
22 logger.debug("GEMS BITWISE AND_")
23 return bitwise_and_func(A, B, out0=A)
26@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, 1, "DEFAULT")])
27@triton.jit
28def bitwise_and_func_scalar(x, y):
29 return x & y
32def bitwise_and_scalar(A, B):
33 logger.debug("GEMS BITWISE AND SCALAR")
34 return bitwise_and_func_scalar(A, B)
37def bitwise_and_scalar_(A, B):
38 logger.debug("GEMS BITWISE AND_ SCALAR")
39 return bitwise_and_func_scalar(A, B, out0=A)
42def bitwise_and_scalar_tensor(A, B):
43 logger.debug("GEMS BITWISE AND SCALAR TENSOR")
44 return bitwise_and_func_scalar(B, A)