Programming Overview#
This page provides a high-level overview of TIRx programming: the design philosophy behind it, the programming model, and the guides in this section.
Design Philosophy#
Kernel DSLs are most effective when they choose the right boundary between the programmer and the machine. For mature kernels on mature hardware, that boundary can be high-level: the compiler hides thread assignment, memory movement, layout details, and instruction selection behind compact tensor or tile abstractions, and this works well for established kernel patterns.
At the frontier, the same boundary is under more pressure. New instructions, memory spaces, cooperation patterns, and kernel algorithms often appear before a compiler has enough built-in machinery to automate them well. At the same time, kernel programming is shifting toward agents, which work best with direct, predictable behavior: code that maps closely to what the hardware does, rather than to decisions a compiler makes behind the scenes.
TIRx chooses a lower and more explicit boundary. It is a generic language built for extension, and its core primitives stay direct and close to the native level of the hardware. The parts of a kernel that frequently require expert control, such as pipeline structure, synchronization, role assignment, memory placement, and backend intrinsics, are written directly in hardware-native source code.
On top of these primitives, TIRx provides a predictable convenience layer for the recurring tile-level structure through three constructs: execution scope, tensor layout, and tile operation dispatch. The layer is optional, and any part of a kernel can drop down to the native primitives.
The result is a language that can grow with the hardware. A new feature can first be used directly as a backend intrinsic, and later become a reusable tile operation once the pattern stabilizes. This is the core design philosophy behind TIRx: keep the foundation small and explicit, and let developers, agents, and the backend library extend it as new accelerator generations arrive.
The Programming Model#
A TIRx program reads as a structured native kernel: loops, branches, tensors, synchronization, pipeline state, backend intrinsics, and hardware roles are written directly. Tile operations appear exactly where a repeated hardware-level operation should become reusable and dispatchable.
Guides in This Section#
Language Basics covers defining and launching kernels.
Control Flow covers conditions, loops, and early thread exit.
Types, Tensors, and Memory covers element types, tensors, and memory spaces.
Metaprogramming covers kernels parameterized by captured values, reusable code fragments, and compile-time specialization.
Calling CUDA and PTX covers calling backend intrinsics, such as synchronization and warp shuffles, PTX instructions, and CUDA C++ device functions directly.
Data Layout covers how tensor elements map to threads and memory.
Tile Operations covers tile operations and the instruction guides.
Compiling and Inspecting covers compiler options and inspecting generated code.
Profiling with IKET covers profiling kernels with IKET.