Coverage for src/flag_gems/ops/bitwise_or.py: 93%
27 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-15 02:11 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-15 02:11 +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_or_func(x, y):
13 return x | y
16def bitwise_or_tensor(A, B):
17 logger.debug("GEMS BITWISE OR")
18 return bitwise_or_func(A, B)
21def bitwise_or_tensor_(A, B):
22 logger.debug("GEMS BITWISE OR_")
23 return bitwise_or_func(A, B, out0=A)
26@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, 1, "DEFAULT")])
27@triton.jit
28def bitwise_or_func_scalar(x, y):
29 return x | y
32def bitwise_or_scalar(A, B):
33 logger.debug("GEMS BITWISE OR SCALAR")
34 return bitwise_or_func_scalar(A, B)
37def bitwise_or_scalar_(A, B):
38 logger.debug("GEMS BITWISE OR_ SCALAR")
39 return bitwise_or_func_scalar(A, B, out0=A)
42def bitwise_or_scalar_tensor(A, B):
43 logger.debug("GEMS BITWISE OR SCALAR TENSOR")
44 return bitwise_or_func_scalar(B, A)