Skip to main content

TaskWorkItem

Struct TaskWorkItem 

Source
#[repr(C)]
pub struct TaskWorkItem {
Show 16 fields pub state: u32, pub op_handle: u32, pub tenant_id: u32, pub priority: u32, pub input_handle: u32, pub output_handle: u32, pub param: u32, pub continuation_pc: u32, pub continuation_data: u32, pub resume_epoch: u32, pub task_id: u32, pub parent_task_id: u32, pub age_ticks: u32, pub requeue_count: u32, pub yield_count: u32, pub flags: u32,
}
Expand description

One device-visible continuation task slot.

The first four words match the persistent ring header: status, opcode, tenant, priority. The remaining twelve words are the slot payload. Words 4..6 preserve the legacy MegakernelWorkItem payload; words 7..15 carry continuation and scheduler state.

Fields§

§state: u32

Raw TaskState word.

§op_handle: u32

Stable op id index into the dialect registry.

§tenant_id: u32

Tenant id checked by the runtime scheduler.

§priority: u32

Raw TaskPriority word.

§input_handle: u32

Input-buffer handle.

§output_handle: u32

Output-buffer handle.

§param: u32

Per-item parameter word.

§continuation_pc: u32

Program counter or block id where the worker should resume.

§continuation_data: u32

Opaque continuation-local scratch word.

§resume_epoch: u32

Device-visible epoch at which the task may resume.

§task_id: u32

Stable task id used to join yielded/requeued continuations.

§parent_task_id: u32

Parent task id for split or fan-out work; zero when absent.

§age_ticks: u32

Scheduler age ticks accumulated while waiting.

§requeue_count: u32

Number of times this task has been requeued.

§yield_count: u32

Number of times this task has yielded.

§flags: u32

Bitset of TASK_FLAG_* continuation flags.

Implementations§

Source§

impl TaskWorkItem

Source

pub const fn from_work_item( task_id: u32, tenant_id: u32, priority: TaskPriority, item: MegakernelWorkItem, ) -> Self

Construct a ready continuation task from the compact legacy work item.

Source

pub const fn work_item(&self) -> MegakernelWorkItem

Return the compact legacy work item payload carried by this task.

Source

pub const fn task_state(&self) -> Option<TaskState>

Decode the task state word.

Source

pub const fn task_priority(&self) -> Option<TaskPriority>

Decode the task priority word.

Source

pub const fn is_schedulable(&self) -> bool

Return true when the task is eligible to be claimed by a worker.

Source

pub fn try_paused( self, continuation_pc: u32, continuation_data: u32, resume_epoch: u32, ) -> Result<Self, BackendError>

Encode a pause at continuation_pc until resume_epoch.

Source

pub fn paused( self, continuation_pc: u32, continuation_data: u32, resume_epoch: u32, ) -> Self

Encode a pause at continuation_pc until resume_epoch.

Source

pub fn try_resumed(self) -> Result<Self, BackendError>

Mark a paused task ready for GPU-side resume.

Source

pub fn resumed(self) -> Self

Mark a paused task ready for GPU-side resume.

Source

pub fn try_yielded( self, continuation_pc: u32, continuation_data: u32, ) -> Result<Self, BackendError>

Yield this task back to the scheduler at continuation_pc.

Source

pub fn yielded(self, continuation_pc: u32, continuation_data: u32) -> Self

Yield this task back to the scheduler at continuation_pc.

Source

pub fn try_requeued( self, continuation_pc: u32, continuation_data: u32, priority: TaskPriority, ) -> Result<Self, BackendError>

Requeue this task, optionally changing its priority partition.

Source

pub fn requeued( self, continuation_pc: u32, continuation_data: u32, priority: TaskPriority, ) -> Self

Requeue this task, optionally changing its priority partition.

Source

pub fn try_completed(self) -> Result<Self, BackendError>

Mark this task completed.

Source

pub fn completed(self) -> Self

Mark this task completed.

Source

pub fn try_faulted(self, fault_code: u32) -> Result<Self, BackendError>

Mark this task faulted with a compact fault code.

Source

pub fn faulted(self, fault_code: u32) -> Self

Mark this task faulted with a compact fault code.

Trait Implementations§

Source§

impl Clone for TaskWorkItem

Source§

fn clone(&self) -> TaskWorkItem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TaskWorkItem

Source§

impl Debug for TaskWorkItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TaskWorkItem

Source§

impl PartialEq for TaskWorkItem

Source§

fn eq(&self, other: &TaskWorkItem) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Pod for TaskWorkItem

Source§

impl StructuralPartialEq for TaskWorkItem

Source§

impl Zeroable for TaskWorkItem

Source§

fn zeroed() -> Self

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyBitPattern for T
where T: Pod,

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CheckedBitPattern for T
where T: AnyBitPattern,

Source§

type Bits = T

Self must have the same layout as the specified Bits except for the possible invalid bit patterns being checked during is_valid_bit_pattern.
Source§

fn is_valid_bit_pattern(_bits: &T) -> bool

If this function returns true, then it must be valid to reinterpret bits as &Self.
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> NoUninit for T
where T: Pod,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more