pub struct DsaSelectScratch { /* private fields */ }Expand description
2026-09-25: Scratch the selection kernels write through, allocated once and reused across steps.
Sized from the largest geometry the caller will run; Self::fits refuses a pass that
would outgrow it.
Implementations§
Source§impl DsaSelectScratch
impl DsaSelectScratch
Sourcepub fn alloc(
gpu: &dyn GpuBackend,
cfg: &Glm5NextDsaConfig,
geom: &DsaSelectGeometry,
) -> Result<Self>
pub fn alloc( gpu: &dyn GpuBackend, cfg: &Glm5NextDsaConfig, geom: &DsaSelectGeometry, ) -> Result<Self>
2026-09-25: Allocate for geom, the largest pass the caller will run
(Glm5NextDsaWorkspace::new plans it at max_dsa_context).
Sourcepub fn tokens(&self) -> DevicePtr
pub fn tokens(&self) -> DevicePtr
2026-09-25: [q_rows, out_width] i32 selection produced by the last pass.
Sourcepub fn row(&self, row: usize, cfg: &Glm5NextDsaConfig) -> Self
pub fn row(&self, row: usize, cfg: &Glm5NextDsaConfig) -> Self
2026-09-25: The same scratch with tokens pointing at row row.
The per-row selector (q_rows == 1) writes each row’s result into its own slot of
the [max_rows, out_width] output, which the attention reads in one launch. The
other regions are temporaries of one pass and are shared.
Sourcepub fn fits(
&self,
cfg: &Glm5NextDsaConfig,
geom: &DsaSelectGeometry,
) -> Result<()>
pub fn fits( &self, cfg: &Glm5NextDsaConfig, geom: &DsaSelectGeometry, ) -> Result<()>
2026-09-25: Whether geom fits what was allocated. select_tokens checks it on every
pass, so a pass larger than the allocation is an error rather than an overrun.
pub fn free(self, gpu: &dyn GpuBackend) -> Result<()>
Trait Implementations§
Source§impl Clone for DsaSelectScratch
impl Clone for DsaSelectScratch
Source§fn clone(&self) -> DsaSelectScratch
fn clone(&self) -> DsaSelectScratch
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more