tilelang.cuda.language.print¶

This module provides macros and utilities for debugging TileLang (tl) programs. It includes functionality to print variables, print values in buffers, conditionally execute debug prints and assert.

Functions¶

print([obj, msg, warp_group_id, warp_id])

A generic print function that handles both TIR buffers and primitive expressions.

Module Contents¶

tilelang.cuda.language.print.print(obj=None, msg='', warp_group_id=0, warp_id=0)¶

A generic print function that handles both TIR buffers and primitive expressions.

  • If the input is a TIR buffer, it prints its values, but only on the first thread (tx=0, ty=0, tz=0).

  • If the input is a TIR primitive expression, it prints its value directly.

Parameters:
  • obj (Any) – The object to print. It can be either a tirx.Buffer, tirx.PrimExpr, or None (for msg-only print).

  • msg (str) – An optional message to include in the print statement.

  • warp_group_id (int) – The warp group id to print.

  • warp_id (print thread will be warp_group_id * warp_group_size +) – The warp id to print.

  • warp_id

Raises:

ValueError – If the input object type is unsupported.

Return type:

None