Coverage for src/flag_gems/runtime/backend/_cambricon/ops/erf.py: 0%
17 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
4import triton.language as tl
5from triton.language.extra.mlu.libdevice import fast_erf as _erf
7from ..utils.pointwise_dynamic import pointwise_dynamic
9logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))
12@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, "DEFAULT")])
13@triton.jit
14def erf_func(x, inplace):
15 output = _erf(x.to(tl.float32))
16 return output
19def erf(x):
20 logger.debug("GEMS_CAMBRICON ERF")
21 return erf_func(x, False)
24def erf_(x):
25 logger.debug("GEMS_CAMBRICON ERF_")
26 return erf_func(x, True, out0=x)