Coverage for src/flag_gems/runtime/backend/_kunlunxin/ops/tan.py: 0%
20 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-23 02:03 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-23 02:03 +0800
1import logging
3import triton
4import triton.language as tl
5from _kunlunxin.utils.codegen_config_utils import CodeGenConfig
7from flag_gems.utils import tl_extra_shim
9from ..utils.pointwise_dynamic import pointwise_dynamic
11logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))
13config_ = CodeGenConfig(
14 512,
15 (65536, 65536, 65536),
16 32,
17 True,
18 prefer_1d_tile=True,
19 buffer_size_limit=4096,
20 unroll_num=4,
21)
24@pointwise_dynamic(promotion_methods=[(0, "INT_TO_FLOAT")], config=config_)
25@triton.jit
26def tan_func(x):
27 y = tl_extra_shim.tan(x.to(tl.float32))
28 return y
31def tan(A):
32 logger.debug("GEMS TAN")
33 return tan_func(A)
36def tan_(A):
37 logger.debug("GEMS TAN_")
38 tan_func(A, out0=A)
39 return A