Coverage for src/flag_gems/runtime/backend/_kunlunxin/ops/erf.py: 0%

17 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2026-03-21 14:31 +0800

1import logging 

2 

3import triton 

4import triton.language as tl 

5from triton.language.extra.xpu.libdevice import erf as _erf 

6 

7from ..utils.pointwise_dynamic import pointwise_dynamic 

8 

9logger = logging.getLogger("flag_gems").getChild(__name__.lstrip(".")) 

10 

11 

12@pointwise_dynamic(promotion_methods=[(0, "DEFAULT")]) 

13@triton.jit 

14def erf_func(x): 

15 output = _erf(x.to(tl.float32)) 

16 return output 

17 

18 

19def erf(x): 

20 logger.debug("GEMS ERF") 

21 return erf_func(x) 

22 

23 

24def erf_(x): 

25 logger.debug("GEMS ERF_") 

26 return erf_func(x, out0=x)