Coverage for src/flag_gems/runtime/backend/_cambricon/ops/log.py: 0%

12 statements  

« prev     ^ index     » next       coverage.py v7.6.9, created at 2026-03-09 01:57 +0800

1import logging 

2 

3import triton 

4import triton.language as tl 

5 

6from ..utils.pointwise_dynamic import pointwise_dynamic 

7 

8logger = logging.getLogger("flag_gems").getChild(__name__.lstrip(".")) 

9 

10 

11@pointwise_dynamic(is_tensor=[True, False], promotion_methods=[(0, "COMPLEX_TO_FLOAT")]) 

12@triton.jit 

13def log_func(x, inplace): 

14 return tl.log(x.to(tl.float32)) 

15 

16 

17def log(A): 

18 logger.debug("GEMS_CAMBRICON LOG") 

19 return log_func(A, False)