Coverage for src/flag_gems/runtime/backend/_cambricon/ops/exp2.py: 0%
15 statements
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-11 02:28 +0800
« prev ^ index » next coverage.py v7.6.9, created at 2026-03-11 02:28 +0800
1import logging
3import triton
4import triton.language as tl
6from ..utils.pointwise_dynamic import pointwise_dynamic
8logger = logging.getLogger(__name__)
11@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, "INT_TO_FLOAT")])
12@triton.jit
13def exp2_func(x, inplace):
14 return tl.exp2(x.to(tl.float32))
17def exp2(A):
18 logger.debug("GEMS_CAMBRICON EXP2")
19 return exp2_func(A, False)
22def exp2_(A):
23 logger.debug("GEMS_CAMBRICON EXP2_")
24 return exp2_func(A, True, out0=A)