tilelang.jit.adapter.cutedsl.adapter¶

Attributes¶

Classes¶

CuTeDSLKernelAdapter

Runtime adapter for generated CuTeDSL Python modules.

Module Contents¶

tilelang.jit.adapter.cutedsl.adapter.logger¶
class tilelang.jit.adapter.cutedsl.adapter.CuTeDSLKernelAdapter(params, result_idx, target, func_or_mod, host_mod=None, device_mod=None, host_kernel_source=None, device_kernel_source=None, verbose=False, pass_configs=None, compile_flags=None)¶

Bases: tilelang.jit.adapter.base.BaseKernelAdapter

Runtime adapter for generated CuTeDSL Python modules.

Parameters:
  • params (list[tilelang.engine.param.KernelParam])

  • result_idx (list[int])

  • target (str | dict[str, object] | tvm.target.Target)

  • func_or_mod (tvm.tirx.PrimFunc | tilelang.tvm.IRModule)

  • host_mod (tilelang.tvm.IRModule | None)

  • device_mod (tilelang.tvm.IRModule | None)

  • host_kernel_source (str | None)

  • device_kernel_source (str | None)

  • verbose (bool)

  • pass_configs (dict[str, Any] | None)

  • compile_flags (list[str] | None)

pymodule = None¶
params¶
result_idx¶
host_kernel_source = None¶
device_kernel_source = None¶
kernel_global_source = None¶
generated_module_source: str | None = None¶
param_dtypes¶
param_shapes = []¶
target¶
verbose = False¶
wrapper¶
host_func¶
function_names¶
launcher_cpp_code¶
launcher_lib_name¶
lib_generator¶
libpath¶
classmethod from_database(params, result_idx, target, func_or_mod, host_kernel_source, device_kernel_source, kernel_lib_path, verbose=False, pass_configs=None, compile_flags=None)¶

Rebuild a CuTeDSL adapter from persisted cache artifacts.

Parameters:
get_host_source()¶

Get the cached host-side source code.

Return type:

str | None

get_generated_module_source()¶

Get the importable generated CuTeDSL Python module source.

Return type:

str | None

get_kernel_source(kernel_only=True)¶

Get the CuTeDSL device source, optionally with host wrapper source.

Returns:

The kernel source code, or None if not available

Return type:

str | None

Parameters:

kernel_only (bool)

cleanup()¶

Explicitly cleanup this adapter’s CUDA resources.

This method can be called explicitly to immediately release CUDA resources without waiting for garbage collection. Useful in Jupyter notebooks or tests.

Note: This is safe to call multiple times as the C++ implementation is idempotent.

property prim_func: tvm.tirx.PrimFunc¶

Returns the primary TIR function from the IR module.

Return type:

tvm.tirx.PrimFunc