Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ nvcc = [

[build-system]
requires = [
"cython>=3.0.0",
"cython>=3.1.0",
"scikit-build-core",
"z3-solver>=4.13.0",
# Not for auditwheel, explicitly add patchelf for repairing libz3.so.
Expand Down
10 changes: 6 additions & 4 deletions tilelang/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@
except ImportError: # Python < 3.10
from typing_extensions import TypeAlias

from typing import Union

from tvm import ir
from tvm import tir

from tvm.tir import BufferLoad, BufferRegion
from tilelang.dtypes import dtype

# Barrier can only be a Buffer, a BufferLoad
BarrierType: TypeAlias = tir.Buffer | BufferLoad
BarrierType: TypeAlias = Union[tir.Buffer, BufferLoad]

# BufferLikeType can be a Buffer, a BufferLoad, a BufferRegion
BufferLikeType: TypeAlias = tir.Buffer | BufferLoad | BufferRegion
BufferLikeType: TypeAlias = Union[tir.Buffer, BufferLoad, BufferRegion]

# This is for Python 3.9 compatibility.
# In Python 3.9, we can only use isinstance(a, (TypeA, TypeB, ...)) instead of isinstance(a, TypeA | TypeB | ...))
Expand All @@ -31,5 +33,5 @@
# - AnyDType is a union of all possible types that can represent a data type, including torch.dtype
# - DType is a more specific type alias that represents a data type in the context of TileLang, and must be
# adapted to string.
DType: TypeAlias = dtype | ir.Type | str | type
ShapeType: TypeAlias = list[tir.PrimExpr | int] | tuple[tir.PrimExpr | int, ...]
DType: TypeAlias = Union[dtype, ir.Type, str, type]
ShapeType: TypeAlias = Union[list[Union[tir.PrimExpr, int]], tuple[Union[tir.PrimExpr, int], ...]]
Loading