pub struct LaunchRecorder { /* private fields */ }Expand description
Records buffer uses for a single launch or copy on launch_stream.
Consume it with Self::enqueue, then consume the returned
EnqueuedLaunch with commit or abort. Dropping a prepared
transaction automatically aborts it and never panics.
§Lifetime model
Registration clones the actual backing owner, not the device bytes, and immediately releases the source borrow. Callers can subsequently borrow mutable kernel parameters. Internal bare block identities are validated against the retained runtime’s allocator during atomic admission.
§Required public call order for non-empty recorders
Self::enqueue MUST own the recorder and the closure MUST
enqueue every operation synchronously on its supplied stream.
Preparation queues the cross-stream waits each recorded access
kind requires (read waits on prior writes; write waits on prior
writes and prior reads), so the operation sees a well-fenced view
of every input. EnqueuedLaunch::commit then records the new
event on launch_stream so future operations can wait on it.
During managed stream capture, the same registration transfers passive
allocation owners and access ranges to the graph without recording events.
Each replay admits its complete manifest before submitting device work.
Nested kernels and graphs use the supplied CudaEnqueue through their
launch_in methods, without preparing another recorder inside the callback.
Empty recorders (no read/write/… calls) are a no-op
and bypass runtime preparation: there are no waits
to queue, no events to record.
Implementations§
Source§impl LaunchRecorder
impl LaunchRecorder
Sourcepub fn new_permissive(launch_stream: StreamId) -> Self
pub fn new_permissive(launch_stream: StreamId) -> Self
Recorder for an unbound execution domain. Owner-bearing inputs are retained.
Sourcepub fn new_strict(launch_stream: StreamId) -> Self
pub fn new_strict(launch_stream: StreamId) -> Self
Recorder eligible for a sealed resident execution domain.
Sourcepub fn launch_stream(&self) -> StreamId
pub fn launch_stream(&self) -> StreamId
Configured launch stream.
Sourcepub fn mode(&self) -> RecorderMode
pub fn mode(&self) -> RecorderMode
Configured mode.
Sourcepub fn read<T: DeviceRepr>(
&mut self,
slice: &(impl DeviceRead<T> + ?Sized),
) -> &mut Self
pub fn read<T: DeviceRepr>( &mut self, slice: &(impl DeviceRead<T> + ?Sized), ) -> &mut Self
Retain the actual allocation/import owner and record its exact read span.
Sourcepub fn write<T: DeviceRepr>(
&mut self,
slice: &(impl DeviceWrite<T> + ?Sized),
) -> &mut Self
pub fn write<T: DeviceRepr>( &mut self, slice: &(impl DeviceWrite<T> + ?Sized), ) -> &mut Self
Retain the actual owner and record the exact writable span, including fresh output allocations and independently imported aliases.
Sourcepub fn read_write<T: DeviceRepr>(
&mut self,
slice: &(impl DeviceWrite<T> + ?Sized),
) -> &mut Self
pub fn read_write<T: DeviceRepr>( &mut self, slice: &(impl DeviceWrite<T> + ?Sized), ) -> &mut Self
Retain an owner-bearing span used for both reading and writing.
Sourcepub fn read_column(&mut self, col: &CudaColumn) -> &mut Self
pub fn read_column(&mut self, col: &CudaColumn) -> &mut Self
Record a column read and retain its allocation or external import token.
Sourcepub fn write_column(&mut self, col: &CudaColumn) -> &mut Self
pub fn write_column(&mut self, col: &CudaColumn) -> &mut Self
Record a crate::memory::CudaColumn the launch will
write.
Sourcepub fn recorded_count(&self) -> usize
pub fn recorded_count(&self) -> usize
Number of recorded registrations before deduplication. Diagnostic.
Sourcepub unsafe fn enqueue<E, F>(
self,
runtime: &Arc<XlogDeviceRuntime>,
operation: F,
) -> Result<EnqueuedLaunch, LaunchEnqueueError<E>>
pub unsafe fn enqueue<E, F>( self, runtime: &Arc<XlogDeviceRuntime>, operation: F, ) -> Result<EnqueuedLaunch, LaunchEnqueueError<E>>
Prepare the recorded uses and synchronously invoke one enqueue operation.
§Safety
operation must enqueue all work synchronously before it returns and use
only the supplied enqueue capability. Every XLOG-owned allocation it
touches must be registered on this recorder with its exact access mode.
Nested operations must reuse that capability rather than admitting
another recorder or submitting independently on its raw stream.