Coverage for src/flag_gems/ops/cos.py: 94%
16 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-09 01:57 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-09 01:57 +0800
1import logging
3import triton
4import triton.language as tl
6from flag_gems.utils import pointwise_dynamic
8logger = logging.getLogger(__name__)
11@pointwise_dynamic(promotion_methods=[(0, "INT_TO_FLOAT")])
12@triton.jit
13def cos_func(x):
14 return tl.cos(x.to(tl.float32))
17def cos(A):
18 logger.debug("GEMS COS")
19 return cos_func(A)
22def cos_(A):
23 logger.debug("GEMS COS_")
24 cos_func(A, out0=A)
25 return A