srdatalog.ir.dialects.relation.d2l.cuda¶
D2L dialect ↔ CUDA target plugin.
How the D2L (Device2LevelIndex) dialect emits as CUDA: registers an
IndexPlugin with codegen.cuda.plugin’s registry that supplies the
per-version view_count (FULL=2 for HEAD+FULL, DELTA/NEW=1) and the
host-side view-setup code emitted around CUDA kernels. Importing
this module — typically via import srdatalog.ir.dialects.relation.d2l
— is enough to register the plugin (the D2L package’s __init__
re-imports this side-effectfully).
D2L design recap:
HEAD + FULL sorted arrays per relation.
Merge: DELTA → HEAD, O(D+H) instead of O(D+F).
Compaction: HEAD → FULL only when HEAD exceeds ratio% of FULL, or at fixpoint exit.
Join (DELTA read): 1 sorted array (same as DSAI).
Join (FULL read): 2 sorted arrays — kernel iterates both via the
D2lSegmentLoopIIR op.
Usage in schema: Path {. index: “SRDatalog::GPU::Device2LevelIndex” .}: Relation[int, int]
Module Contents¶
Functions¶
Build a Device2LevelIndex plugin by starting from the default DSAI plugin and overriding the view-level hooks. Expression-level hooks are unchanged — once the kernel has a view, prefix/degree/valid/get all work identically. |
Data¶
API¶
- srdatalog.ir.dialects.relation.d2l.cuda.new_two_level_plugin() srdatalog.ir.codegen.cuda.plugin.IndexPlugin[source]¶
Build a Device2LevelIndex plugin by starting from the default DSAI plugin and overriding the view-level hooks. Expression-level hooks are unchanged — once the kernel has a view, prefix/degree/valid/get all work identically.
- srdatalog.ir.dialects.relation.d2l.cuda.two_level_plugin¶
‘new_two_level_plugin(…)’