tilelang.language.customize¶

The language interface for tl programs.

Functions¶

dp4a(A, B, C)

Perform a 4-element dot product with accumulation (DP4A).

clamp(dst, min_val, max_val)

Clamps the input value dst between [min_val, max_val]

reshape(src, shape)

Reshapes the input buffer to the specified shape.

view(src[, shape, dtype])

Return a Tensor view of the input buffer with an optional new shape and dtype.

loop_break()

Break out of the current loop.

Module Contents¶

tilelang.language.customize.dp4a(A, B, C)¶

Perform a 4-element dot product with accumulation (DP4A).

Parameters:
  • A (Buffer) – First input buffer

  • B (Buffer) – Second input buffer

  • C (Buffer) – Accumulation buffer

Returns:

Handle to the DP4A operation

Return type:

PrimExpr

tilelang.language.customize.clamp(dst, min_val, max_val)¶

Clamps the input value dst between [min_val, max_val]

Parameters:
  • dst (tvm.tir.PrimExpr) – Input value to be clamped

  • min_val (tvm.tir.PrimExpr) – Minimum value

  • max_val (tvm.tir.PrimExpr) – Maximum value

Returns:

Value clamped to the specified range

Return type:

tvm.tir.PrimExpr

tilelang.language.customize.reshape(src, shape)¶

Reshapes the input buffer to the specified shape.

Parameters:
  • src (Buffer) – Input buffer to be reshaped

  • shape (List[PrimExpr]) – New shape for the buffer

Returns:

A new buffer view with the specified shape

Return type:

Buffer

tilelang.language.customize.view(src, shape=None, dtype=None)¶

Return a Tensor view of the input buffer with an optional new shape and dtype.

If shape is None the source buffer’s shape is used; if dtype is None the source buffer’s dtype is used. The returned buffer shares the same underlying data as src (no copy).

Parameters:
  • src (tvm.tir.Buffer)

  • shape (list[tvm.tir.PrimExpr] | None)

  • dtype (str | None)

Return type:

tvm.tir.Buffer

tilelang.language.customize.loop_break()¶

Break out of the current loop.

Returns:

A call to the tl.loop_break intrinsic.

Return type:

tir.Call