cuda.tile.arange#
- cuda.tile.arange(size, /, *, dtype)#
Creates a tile with value starting from 0 to size - 1.
- Parameters:
size (const int) – Size of the tile.
dtype (DType) – Datatype of the tile.
- Return type:
Examples
tile = ct.arange(4, dtype=ct.int32) print(tile)
import cuda.tile as ct import torch @ct.kernel def kernel(): tile = ct.arange(4, dtype=ct.int32) print(tile) torch.cuda.init() ct.launch(torch.cuda.current_stream(), (1,), kernel, ()) torch.cuda.synchronize()
Output
[0, 1, 2, 3]