Struct HalComputeLane
pub struct HalComputeLane { /* private fields */ }Expand description
Etalon compute lane with queue-scoped callback completion on native and WebGPU.
Implementations§
§impl HalComputeLane
impl HalComputeLane
Creates a lane from a checked pair. queue_id remains caller metadata.
§impl HalComputeLane
impl HalComputeLane
pub fn new( device: Arc<Device>, queue: Arc<Queue>, queue_id: QueueId, ) -> HalComputeLane
pub fn device(&self) -> &Device
pub fn queue(&self) -> &Queue
pub fn submitted_counter(&self) -> u64
pub fn completed_counter(&self) -> u64
pub fn completed_counter_handle(&self) -> Arc<Atomic<u64>> ⓘ
pub fn verified_submission(&self) -> Option<PerQueueCompletionToken>
pub fn verify_submission(
&mut self,
token: PerQueueCompletionToken,
expected: &[u8],
actual: &[u8],
) -> Result<(), HalOracleError>
pub fn verify_submission( &mut self, token: PerQueueCompletionToken, expected: &[u8], actual: &[u8], ) -> Result<(), HalOracleError>
Compare a CPU reference with caller-supplied readback from the latest completed submission.
pub fn submit_command_buffer(
&mut self,
cmd: CommandBuffer,
) -> Result<PerQueueCompletionToken, &'static str>
pub fn submit_command_buffer( &mut self, cmd: CommandBuffer, ) -> Result<PerQueueCompletionToken, &'static str>
Submit a recorded command buffer and track GPU completion via on_submitted_work_done.
pub fn wait_for(&self, token: PerQueueCompletionToken) -> bool
pub fn wait_for(&self, token: PerQueueCompletionToken) -> bool
Block until the GPU has completed all work up to token.
pub async fn wait_for_async(&self, token: PerQueueCompletionToken) -> bool
pub async fn wait_for_async(&self, token: PerQueueCompletionToken) -> bool
Await queue completion without blocking. Native runtimes must keep polling the device elsewhere until completion; browser WebGPU progresses on its event loop.
pub fn lease_submission<T>(
&mut self,
cmd: CommandBuffer,
resource: T,
region: BufferRegion,
) -> Result<(PerQueueCompletionToken, SubmissionLease<T>), (T, &'static str)>where
T: WasmNotSendSync + 'static,
pub fn lease_submission<T>(
&mut self,
cmd: CommandBuffer,
resource: T,
region: BufferRegion,
) -> Result<(PerQueueCompletionToken, SubmissionLease<T>), (T, &'static str)>where
T: WasmNotSendSync + 'static,
Submit work and retain its resource until this queue completes, even if the lease is dropped. Submission failure returns the resource and error. This cold operation allocates.
Trait Implementations§
§impl ComputeLane for HalComputeLane
impl ComputeLane for HalComputeLane
type Error = &'static str
type PreparedPlan = HalPreparedPlan
type Submission = HalSubmission
§fn state(&self) -> CapabilityState
fn state(&self) -> CapabilityState
Current capability state of this lane.
§fn prepare(
&mut self,
plan: &<HalComputeLane as ComputeLane>::PreparedPlan,
) -> Result<(), <HalComputeLane as ComputeLane>::Error>
fn prepare( &mut self, plan: &<HalComputeLane as ComputeLane>::PreparedPlan, ) -> Result<(), <HalComputeLane as ComputeLane>::Error>
Cold path: allocate resources, compile pipelines, and validate layouts.
§fn submit(
&mut self,
submission: <HalComputeLane as ComputeLane>::Submission,
) -> Result<PerQueueCompletionToken, <HalComputeLane as ComputeLane>::Error>
fn submit( &mut self, submission: <HalComputeLane as ComputeLane>::Submission, ) -> Result<PerQueueCompletionToken, <HalComputeLane as ComputeLane>::Error>
Hot path: zero-allocation submission to hardware queues.
§fn poll_completion(&self, token: PerQueueCompletionToken) -> bool
fn poll_completion(&self, token: PerQueueCompletionToken) -> bool
Non-blocking check for token completion.
Auto Trait Implementations§
impl !RefUnwindSafe for HalComputeLane
impl !UnwindSafe for HalComputeLane
impl Freeze for HalComputeLane
impl Send for HalComputeLane
impl Sync for HalComputeLane
impl Unpin for HalComputeLane
impl UnsafeUnpin for HalComputeLane
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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