cuda.tile.bitwise_rshift#

cuda.tile.bitwise_rshift(x, y, /)#

Elementwise bitwise_rshift on two tiles.

Can also use builtin operation x >> y.

Parameters:
  • x (Tile) – LHS tile.

  • y (Tile) – RHS tile.

The shape of x and y will be broadcasted and dtype promoted to common dtype.

Return type:

Tile

Examples

tx = ct.full((4,), 8, dtype=ct.int32)
ty = ct.arange(4, dtype=ct.int32)
print(tx >> ty)
import cuda.tile as ct
import torch

@ct.kernel
def kernel():
    tx = ct.full((4,), 8, dtype=ct.int32)
    ty = ct.arange(4, dtype=ct.int32)
    print(tx >> ty)


torch.cuda.init()
ct.launch(torch.cuda.current_stream(), (1,), kernel, ())
torch.cuda.synchronize()

Output

[8, 4, 2, 1]