Tensor Creation
make_tensor
Creates a tensor from a pointer and layout.Pointer
required
Pointer to memory (global, shared, or register)
Layout
required
Layout defining shape and stride
make_fragment
Allocates a register memory tensor (fragment).Type[Numeric]
required
Element data type (e.g.,
cute.Float32, cute.BFloat16)Layout
required
Layout of the fragment
make_fragment_like
Allocates a fragment with the same shape as another tensor.Tensor
required
Template tensor
make_rmem_tensor
Allocates register memory tensor.make_fragment.
make_rmem_tensor_like
Allocates register memory tensor matching another tensor.make_fragment_like.
Tensor Initialization
zeros_like
Creates a tensor initialized to zero.ones_like
Creates a tensor initialized to one.full
Creates a tensor filled with a specific value.Layout
required
Tensor layout
Numeric
required
Fill value
Type[Numeric]
required
Element data type
full_like
Creates a tensor filled with a value, matching another tensor’s shape.empty_like
Allocates an uninitialized tensor matching another tensor’s shape.Pointer Operations
make_ptr
Creates a typed pointer from raw memory address.Union[int, Tensor]
required
Memory address or tensor
Type[Numeric]
required
Element data type
AddressSpace
default:"GLOBAL"
Memory address space
recast_ptr
Recasts a pointer to a different element type.Pointer
required
Original pointer
Type[Numeric]
required
New element data type
Layout Operations
make_layout
Creates a layout from shape and stride.Shape
required
Shape tuple (can be nested)
Stride
default:"compact"
Stride tuple (defaults to compact row-major)
make_identity_layout
Creates an identity layout (coordinate layout).make_ordered_layout
Creates a layout with specified dimension ordering.make_layout_like
Creates a layout matching another layout’s shape.recast_layout
Recasts a layout to a different element type.Identity and Coordinate Tensors
make_identity_tensor
Creates a coordinate tensor for bounds checking.Shape
required
Tensor shape
Tensor Recasting
recast_tensor
Recasts a tensor to a different element type.Tensor
required
Original tensor
Type[Numeric]
required
New element data type
Memory Space Management
Address Spaces
Tensor Partitioning
Partition by Tiled Copy
Partition by Tiled MMA
Complete Example: Memory Management
See Also
- Kernel Definition - Defining GPU kernels
- Operations Reference - DSL operations
- Atom Operations - Copy and MMA atoms