pub struct WorkspaceReq {
pub a_bytes: usize,
pub tile_bytes: usize,
pub worker_scatter: usize,
pub b_bytes: usize,
pub team_scatter: usize,
pub barriers: usize,
}Expand description
Bytes and counts one execute needs. Buffer sizes are bytes because the provider is element-type erased: the driver knows the element type and converts its real counts once.
A zero entry never allocates.
Fields§
§a_bytes: usizeThis thread’s packed A block.
tile_bytes: usizeThis thread’s accumulator tile, including any induced-method scratch.
worker_scatter: usizeElements reserved for this thread’s scatter scratch.
b_bytes: usizeThe team’s shared packed B panel.
team_scatter: usizeElements reserved for the team’s block-scatter vectors.
barriers: usizeBarriers the team needs, or zero when nothing is shared.
Implementations§
Source§impl WorkspaceReq
impl WorkspaceReq
Sourcepub fn bytes(&self) -> usize
pub fn bytes(&self) -> usize
The payload this request needs, in bytes: the buffers, the i64 scatter
elements and the barriers. It is the value a Workspace is sized to and
the amount Workspace::have reports.
§Examples
use tcontract_exec::WorkspaceReq;
let req = WorkspaceReq { a_bytes: 16, team_scatter: 2, ..Default::default() };
assert_eq!(req.bytes(), 16 + 2 * core::mem::size_of::<i64>());Sourcepub fn covered_by(&self, have: &WorkspaceReq) -> bool
pub fn covered_by(&self, have: &WorkspaceReq) -> bool
Whether have covers every component of this request.
Capacity is checked component-wise, never by the byte total: a large A
block does not stand in for a missing B panel, and the driver would grow
the arena for the shortage rather than refuse it. Workspace::reserve
keeps the same component-wise maxima.
Trait Implementations§
Source§impl Clone for WorkspaceReq
impl Clone for WorkspaceReq
impl Copy for WorkspaceReq
Source§impl Debug for WorkspaceReq
impl Debug for WorkspaceReq
Source§impl Default for WorkspaceReq
impl Default for WorkspaceReq
impl Eq for WorkspaceReq
Source§impl PartialEq for WorkspaceReq
impl PartialEq for WorkspaceReq
impl StructuralPartialEq for WorkspaceReq
Auto Trait Implementations§
impl Freeze for WorkspaceReq
impl RefUnwindSafe for WorkspaceReq
impl Send for WorkspaceReq
impl Sync for WorkspaceReq
impl Unpin for WorkspaceReq
impl UnsafeUnpin for WorkspaceReq
impl UnwindSafe for WorkspaceReq
Blanket Implementations§
impl<T> Boilerplate for T
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,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more