Tensor Creation
make_tensor
Creates a tensor from a pointer and layout.Pointer to memory (global, shared, or register)
Layout defining shape and stride
make_fragment
Allocates a register memory tensor (fragment).Element data type (e.g.,
cute.Float32, cute.BFloat16)Layout of the fragment
make_fragment_like
Allocates a fragment with the same shape as another tensor.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.Tensor layout
Fill value
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.Memory address or tensor
Element data type
Memory address space
recast_ptr
Recasts a pointer to a different element type.Original pointer
New element data type
Layout Operations
make_layout
Creates a layout from shape and stride.Shape tuple (can be nested)
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.Tensor shape
Tensor Recasting
recast_tensor
Recasts a tensor to a different element type.Original tensor
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