Coverage for src/flag_gems/runtime/backend/_kunlunxin/ops/minimum.py: 0%
18 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-17 02:35 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-17 02:35 +0800
1import logging
3import triton
4import triton.language as tl
6from flag_gems.runtime import device
8from ..utils.pointwise_dynamic import pointwise_dynamic
10logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))
11device = device.name
14@pointwise_dynamic(is_tensor=[True, True], promotion_methods=[(0, 0, "DEFAULT")])
15@triton.jit
16def minimum_kernel(X, Y):
17 if X.dtype == tl.bfloat16:
18 X = X.to(tl.float32)
19 Y = Y.to(tl.float32)
20 return tl.minimum(X, Y)
23def minimum(X, Y):
24 logger.debug("GEMS MINIMUM")
25 assert X.device.type == device and Y.device.type == device
26 return minimum_kernel(X, Y)