tvm_tirx.backend.cuda.codegen.device_intrinsic#
- tvm_tirx.backend.cuda.codegen.device_intrinsic(op_name, *, helper_name=None, c_signature='()', body, n_attrs=0, return_type='void', tvm_return_type=None, templated=False, extra_deps=())#
Register a CUDA device-helper intrinsic.
- Parameters:
op_name (str) – Registry key —
call_intrin("", "tirx.<op_name>", ...)resolves here. Also used as the default helper name (tvm_builtin_<op_name>) whenhelper_nameis not provided.helper_name (str | Callable | None) – Literal C function name, OR
(*args) -> strto compute it from attr values. Defaults tof"tvm_builtin_{op_name}".c_signature (str | Callable) – Literal C parameter list including outer parens (
"(int x, int y)"), OR(*args) -> strto compute it from attr values. Defaults to"()".body (str | Callable) – Literal C body string (already indented), OR
(*args) -> str.n_attrs (int) – Number of trailing args that are attrs (consumed by
helper_name/c_signature/bodycallables, NOT forwarded to the helper as call arguments). The firstlen(args) - n_attrsargs are the operand args forwarded to the helper.return_type (str | Callable) – C return type. Default
"void". Either a literal string or(*args) -> strwhen the helper return type depends on attrs.tvm_return_type (str | Callable | None) – TVM dtype for the call result, when the helper has a non-void return. Either a literal string (
"int32") or(*args) -> str. If omitted andreturn_typeis non-void, it is auto-derived from the_C_TO_TVM_DTYPEtable.templated (bool) – Prefix the helper with
template <typename T>.extra_deps (tuple) – Helper-tag list (e.g.
("get_tmem_addr",)) forwarded as the second element of the codegen result so the header generator emits the prerequisite snippets.
- Return type:
None