tilelang.language.copyΒΆ
The language interface for tl programs.
FunctionsΒΆ
|
Create a memory region descriptor for tile operations. |
|
Convert a TVM buffer to a tile region descriptor. |
|
Convert a buffer load operation to a tile region descriptor. |
|
Convert a buffer region to a tile region descriptor. |
|
Copy data between memory regions. |
|
Perform im2col transformation for 2D convolution. |
Module ContentsΒΆ
- tilelang.language.copy.region(buffer, access_type, *args)ΒΆ
Create a memory region descriptor for tile operations.
- Parameters:
buffer (tir.BufferLoad) β The buffer to create a region for
access_type (str) β Type of access - βrβ for read, βwβ for write, βrwβ for read-write
*args (tir.PrimExpr) β Extent expressions defining the region size
- Returns:
A region descriptor for tile operations
- Return type:
tir.Call
- tilelang.language.copy.buffer_to_tile_region(buffer, access_type)ΒΆ
Convert a TVM buffer to a tile region descriptor.
- Parameters:
buffer (tir.Buffer) β The buffer to convert
access_type (str) β Type of access - βrβ for read, βwβ for write, βrwβ for read-write
- Returns:
A region descriptor covering the entire buffer
- Return type:
tir.Call
- tilelang.language.copy.buffer_load_to_tile_region(load, access_type, extents)ΒΆ
Convert a buffer load operation to a tile region descriptor.
- Parameters:
load (tir.BufferLoad) β The buffer load operation
access_type (str) β Type of access - βrβ for read, βwβ for write, βrwβ for read-write
extents (List[tir.PrimExpr]) β List of expressions defining the region size
- Returns:
A region descriptor for the loaded area
- Return type:
tir.Call
- tilelang.language.copy.buffer_region_to_tile_region(buffer_region, access_type, extents)ΒΆ
Convert a buffer region to a tile region descriptor.
- Parameters:
buffer_region (tir.BufferRegion) β The buffer region to convert
access_type (str) β Type of access - βrβ for read, βwβ for write, βrwβ for read-write
extents (List[tvm.tir.PrimExpr])
- Returns:
A region descriptor for the specified buffer region
- Return type:
tir.Call
- tilelang.language.copy.copy(src, dst, coalesced_width=None, disable_tma=False)ΒΆ
Copy data between memory regions.
- Parameters:
src (Union[tir.Buffer, tir.BufferLoad, tir.BufferRegion]) β Source memory region
dst (Union[tir.Buffer, tir.BufferLoad]) β Destination memory region
coalesced_width (Optional[int], optional) β Width for coalesced memory access. Defaults to None.
disable_tma (bool)
- Raises:
TypeError β If copy extents cannot be deduced from arguments
- Returns:
A handle to the copy operation
- Return type:
tir.Call
- tilelang.language.copy.c2d_im2col(img, col, nhw_step, c_step, kernel, stride, dilation, pad)ΒΆ
Perform im2col transformation for 2D convolution.
- Parameters:
img (tir.Buffer) β Input image buffer
col (tir.Buffer) β Output column buffer
nhw_step (tir.PrimExpr) β Step size for batch and spatial dimensions
c_step (tir.PrimExpr) β Step size for channel dimension
kernel (int) β Kernel size
stride (int) β Stride of the convolution
dilation (int) β Dilation rate
pad (int) β Padding size
- Returns:
A handle to the im2col operation
- Return type:
tir.Call