tvm_tirx.backend.cuda.codegen

Contents

tvm_tirx.backend.cuda.codegen#

Shared machinery behind every CUDA device-intrinsic codegen.

Both dialects build on this layer: tvm_tirx.backend.cuda.ptx renders PTX instructions from a table, and tvm_tirx.backend.cuda.cpp registers hand-written CUDA C++ device helpers.

  • registry — the op-name → codegen map C++ queries during codegen.

  • schema — device_intrinsic(), the declarative helper registration.

  • header — CUDA header generator and its helper-tag table.

  • types — PTX dtype enum mirroring src/backend/cuda/codegen/ptx.cc.

  • utils — small parsing / validation helpers.

Importing registry and header is load-bearing: their module-level register_global_func decorators publish tirx.intrinsics.cuda.get_codegen and tirx.intrinsics.cuda.header_generator, which codegen_cuda.cc looks up when it emits a kernel. Nothing else imports them for their side effects, so dropping them here fails at kernel-build time, not at import time.

Classes#

PTXDataType(*values)

A Python equivalent of the provided C++ DataType enum class.

Functions#

header_generator

Callable wrapper around a TVM FFI function.

get_codegen

Callable wrapper around a TVM FFI function.

register_codegen(op[, backend])

Register a codegen function for a given op.

device_intrinsic(op_name, *[, helper_name, ...])

Register a CUDA device-helper intrinsic.