srdatalog.ir.codegen.cuda.complete_runner

Complete runner struct emission.

Port of src/srdatalog/codegen/target_jit/jit_complete_runner.nim.

Emits struct JitRunner_<rule> — the per-rule launcher scaffold that wraps count, materialize, and (optionally) fused global kernels with host-side setup / launch phase methods and execute() entry.

Entry point: gen_complete_runner(node, db_type_name, rel_index_types={}) -> (decl, full)

full is the complete struct + out-of-line phase method definitions (goes into the JIT batch file). decl is a minimal forward-declaration struct (goes into the main compile unit).

Scope: baseline non-recursive emit supporting:

  • ColumnJoin / ColumnSource sources with FULL_VER / DELTA_VER / NEW_VER

  • kernel_count + kernel_materialize + kernel_fused

  • setup / launch_count / scan_and_resize / scan_only / read_total / launch_materialize / launch_fused / read_fused_result

  • execute + execute_fused

  • Tiled Cartesian materialize body (when eligible)

  • count-only pipelines (ep.count): kernel_materialize discarded

Unsupported (raise NotImplementedError): work_stealing, block_group, dedup_hash, balanced scan, fan-out, materialized pipelines.

Module Contents

Functions

gen_complete_runner

Generate (decl, full) for one ExecutePipeline.

API

srdatalog.ir.codegen.cuda.complete_runner.gen_complete_runner(node: srdatalog.ir.mir.types.ExecutePipeline, db_type_name: str, rel_index_types: dict[str, str] | None = None) tuple[str, str][source]

Generate (decl, full) for one ExecutePipeline.

full is the complete struct with kernel definitions + out-of-line phase method bodies (goes into the JIT batch file). decl is a minimal forward-declaration struct with type aliases + LaunchParams + method declarations only (goes into the main compile unit so the orchestrator can call JitRunner_X::execute()).