tilus.Script.store_global

tilus.Script.store_global

Script.store_global(dst, src, *, offsets, dims=None)[source]

Store a register tensor into a slice of a global tensor.

This instruction stores the contents of the register tensor x into a slice of the global tensor dst.

The offsets parameter specifies the starting offsets for each dimension of the global tensor where the register tensor will be stored. The length of this sequence must match the number of dimensions of the global tensor.

The dims parameter specifies which dimensions of the global tensor are being sliced. The dimension dim[0] of the global tensor corresponds to the first dimension of the register tensor, dim[1] to the second, and so on. If dims is not provided, it is assumed to be range(len(dst.shape)), meaning all dimensions of the global tensor are being sliced in the same order as the register tensor. When provided, the length of this sequence must match the number of dimensions of the register tensor being stored.

Parameters:
  • dst (GlobalTensor) – The global tensor to store into.

  • src (RegisterTensor) – The register tensor to store into the global tensor.

  • offsets (Sequence[Expr | int]) – The offsets for each dimension of the global tensor where the register tensor will be stored.

  • dims (Sequence[int], optional) – The dimensions of the global tensor that are being sliced.

Return type:

None