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