cuda.tile.bitcast#

cuda.tile.bitcast(x, /, dtype)#

Reinterpets tile as being of specified data type.

Parameters:
  • x (Tile) – input tile.

  • dtype (DType) – target data type.

Return type:

Tile

Examples

ty = ct.bitcast(1.0, ct.uint32)
print(f"{ty:#x}")
import cuda.tile as ct
import torch

@ct.kernel
def kernel():
    ty = ct.bitcast(1.0, ct.uint32)
    print(f"{ty:#x}")


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

Output

0x3f800000