metrale_kernels/query.rs
1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3//! 2026-09-25: Whole-registry lookups over the compiled targets: enumerate
4//! them, or find one by a substring of its model name. [`super::resolve`]
5//! picks the target for a checkpoint.
6//!
7//! Owner: kernels crate.
8//! Invariants: none beyond the types.
9
10use super::{TargetPtxSet, all_ptx_sets};
11
12/// 2026-09-25: Every compiled kernel target, one entry per target
13/// (`all_ptx_sets()`); empty under the `METRALE_SKIP_BUILD` stub.
14pub fn available_targets() -> Vec<TargetPtxSet> {
15 all_ptx_sets()
16}
17
18/// 2026-09-25: The first compiled target whose model name contains
19/// `needle` (case-sensitive), or `None`.
20pub fn ptx_for_model(needle: &str) -> Option<TargetPtxSet> {
21 all_ptx_sets()
22 .into_iter()
23 .find(|t| t.target.model.contains(needle))
24}