Coverage for src/flag_gems/ops/atan2.py: 94%
16 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-05-26 06:59 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-05-26 06:59 +0800
1import logging
3import triton
4import triton.language as tl
6from flag_gems.utils import pointwise_dynamic, tl_extra_shim
8_atan2 = tl_extra_shim.atan2
10logger = logging.getLogger(__name__)
13@pointwise_dynamic(promotion_methods=[(0, 1, "DEFAULT")])
14@triton.jit
15def atan2_kernel(x, y):
16 return _atan2(x.to(tl.float32), y.to(tl.float32))
19def atan2(input, other):
20 logger.debug("GEMS ATAN2")
21 return atan2_kernel(input, other)
24def atan2_out(input, other, out):
25 logger.debug("GEMS ATAN2_OUT")
26 return atan2_kernel(input, other, out0=out)