pub struct Config { /* private fields */ }Expand description
One point in a kernel’s configuration space: a total assignment of every declared dimension. Dimensions are kept sorted by name, which is what makes the canonical ID canonical.
Implementations§
Source§impl Config
impl Config
Sourcepub fn get(&self, dim: &str) -> Option<&Value>
pub fn get(&self, dim: &str) -> Option<&Value>
The value assigned to one dimension, or None if the spec does not
declare it.
Sourcepub fn values(&self) -> impl Iterator<Item = (&str, &Value)>
pub fn values(&self) -> impl Iterator<Item = (&str, &Value)>
Every (dimension, value) pair, ascending by dimension name.
The order is the sorted order, not the declaration order, and it is
what makes Config::id canonical: two configurations that assign
the same values hash identically however their spec was written.
Sourcepub fn block_threads(&self) -> u64
pub fn block_threads(&self) -> u64
Total threads per block implied by this configuration. Absent block dimensions default to 1, matching CUDA launch semantics.
Saturating, like grid_blocks in launchbound-model, and for the
same reason: the factors come from kernel.toml, and .product() over
three attacker-shaped u64s panics in a debug build and wraps in a
release one — where a wrapped value would then flow into estimate and
into the gate’s threads > WARP_SIZE test and be believed.
A valid spec cannot reach the saturation point: KernelSpec rejects a
block dimension above the CUDA per-axis limit at load, so the largest
product this can be asked for is 1024 x 1024 x 64. The saturation is
the floor under a Config built by some other route.
Sourcepub fn id(&self) -> ConfigId
pub fn id(&self) -> ConfigId
The canonical, stable ID: a versioned SHA-256 over the kernel name
and the sorted dimension assignments. Changing the encoding is a
breaking change and must bump the config.v1 tag.
Sourcepub fn spec_key(&self, spec: &KernelSpec) -> String
pub fn spec_key(&self, spec: &KernelSpec) -> String
Only the compile-time specialization dimensions, sorted. Candidates sharing this key share generated source, and therefore share one reconverge verdict and one compiled artifact.
Trait Implementations§
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.