pub struct KernelSpec {
pub name: String,
pub entry: String,
pub domain: u8,
pub needs_cc: Option<String>,
pub known: SafetyExpectation,
pub dir: PathBuf,
pub dims: Vec<Dim>,
pub constraints: Vec<Constraint>,
}Expand description
A kernel’s declared tuning space, loaded from kernel.toml.
Fields§
§name: StringKernel name, matching the corpus directory.
entry: StringThe #[kernel] entry function name.
domain: u8Launch-contract domain (1, 2 or 3).
needs_cc: Option<String>Minimum compute capability the kernel needs, e.g. “7.0”.
known: SafetyExpectationWhat the corpus asserts this kernel’s gate result should be, so a regression in the analyzer shows up as a corpus failure.
dir: PathBufDirectory holding the kernel crate (where kernel.toml lives).
dims: Vec<Dim>Every declared dimension, sorted by name — the order that makes
crate::Config::id canonical.
constraints: Vec<Constraint>Expressions every enumerated configuration must satisfy.
Implementations§
Source§impl KernelSpec
impl KernelSpec
Sourcepub fn load(dir: &Path) -> Result<Self, SpaceError>
pub fn load(dir: &Path) -> Result<Self, SpaceError>
Load <dir>/kernel.toml.
Sourcepub fn from_toml_str(origin: &str, text: &str) -> Result<Self, SpaceError>
pub fn from_toml_str(origin: &str, text: &str) -> Result<Self, SpaceError>
Parse from a string (tests).
Sourcepub fn dim(&self, name: &str) -> Option<&Dim>
pub fn dim(&self, name: &str) -> Option<&Dim>
One dimension by name, or None if the spec does not declare it.
Sourcepub fn dims_sorted(&self) -> Vec<&Dim>
pub fn dims_sorted(&self) -> Vec<&Dim>
Dimensions in canonical (name-sorted) order.
Trait Implementations§
Source§impl Clone for KernelSpec
impl Clone for KernelSpec
Source§fn clone(&self) -> KernelSpec
fn clone(&self) -> KernelSpec
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for KernelSpec
impl RefUnwindSafe for KernelSpec
impl Send for KernelSpec
impl Sync for KernelSpec
impl Unpin for KernelSpec
impl UnsafeUnpin for KernelSpec
impl UnwindSafe for KernelSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more