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

15 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2026-03-13 10:08 +0800

1import logging 

2 

3import triton 

4import triton.language as tl 

5 

6from flag_gems.utils import tl_extra_shim 

7 

8from ..utils.pointwise_dynamic import pointwise_dynamic 

9 

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

11 

12 

13_acos = tl_extra_shim.acos 

14 

15 

16@pointwise_dynamic(promotion_methods=[(0, "INT_TO_FLOAT")]) 

17@triton.jit() 

18def acos_kernel(x): 

19 # TODO: use flag_gems.utils.tl_extra_shim help apis 

20 return _acos(x.to(tl.float32)) 

21 

22 

23def acos(x): 

24 logger.debug("GEMS ACOS FORWARD") 

25 y = acos_kernel(x) 

26 return y