cuda.tile.log2#
- cuda.tile.log2(x, /)#
Perform log2 on a tile.
Examples
tx = ct.full((4,), 8.0, dtype=ct.float32) print(f"{ct.log2(tx):.1f}")
import cuda.tile as ct import torch @ct.kernel def kernel(): tx = ct.full((4,), 8.0, dtype=ct.float32) print(f"{ct.log2(tx):.1f}") torch.cuda.init() ct.launch(torch.cuda.current_stream(), (1,), kernel, ()) torch.cuda.synchronize()
Output
[3.0, 3.0, 3.0, 3.0]