tilelang.ascend.callback¶
Ascend dialect code-generation callbacks.
The Ascend runtime-module build (src/ascend/codegen/rt_mod_ascend.cc) looks up
the tilelang_callback_ascend_postproc global before emitting the final
AscendC source; registering a function here lets users rewrite the generated
code the same way the CUDA/HIP postproc callbacks do for their backends.
Functions¶
|
Register a post-processing function for Ascend-family code generation. |
|
Decorator for registering an Ascend-family post-processing callback. |
Module Contents¶
- tilelang.ascend.callback.register_ascend_postproc(func, override=True)¶
Register a post-processing function for Ascend-family code generation.
The callback receives the generated AscendC source for an Ascend target.
- Parameters:
func (collections.abc.Callable[[str, tvm.target.Target], str]) – A callable that takes generated code (str) and target (Target) as input, and returns the processed code (str).
override (bool) – Whether to override existing registered function. Defaults to True.
- tilelang.ascend.callback.register_ascend_postproc_callback(func=None, override=True)¶
Decorator for registering an Ascend-family post-processing callback.
The callback receives the generated AscendC source for an Ascend target.
- Can be used with or without parentheses:
@register_ascend_postproc_callback def func(code, target): …
@register_ascend_postproc_callback() def func(code, target): …
@register_ascend_postproc_callback(override=False) def func(code, target): …