Coverage for src/flag_gems/runtime/backend/_cambricon/ops/ceil.py: 0%
22 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-17 02:35 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-17 02:35 +0800
1import logging
3import triton
4import triton.language as tl
6from ..utils.pointwise_dynamic import pointwise_dynamic
8logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))
11@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, "DEFAULT")])
12@triton.jit
13def ceil_func(x, inplace):
14 return tl.ceil(x.to(tl.float32)).to(x.dtype)
17def ceil(A):
18 logger.debug("GEMS_CAMBRICON CEIL")
19 return ceil_func(A, False)
22def ceil_out(A, *, out=None):
23 logger.debug("GEMS_CAMBRICON CEIL_OUT")
24 if out is None:
25 return ceil_func(A, False)
26 ceil_func(A, False, out0=out)
27 return out
30def ceil_(A):
31 logger.debug("GEMS_CAMBRICON CEIL_")
32 ceil_func(A, True, out0=A)
33 return A