pub trait DeviceStream {
type Fence: Fence + Send + 'static;
type DeviceStorage: ComputeStorage;
type HostStorage: ComputeStorage;
type Signal: Copy;
// Required methods
fn device_memory(&mut self) -> &mut MemoryManagement<Self::DeviceStorage>;
fn host_memory(&mut self) -> &mut MemoryManagement<Self::HostStorage>;
fn drop_queue(&mut self) -> &mut PendingDropQueue<Self::Fence>;
fn capturing(&mut self) -> &mut StreamCapture;
fn info_cache(&mut self) -> &mut MetadataInfoCache<Handle>;
fn signal(&self) -> Self::Signal;
fn fence(signal: Self::Signal) -> Self::Fence;
}Expand description
The state a backend’s stream keeps beside its driver handle.
All of it moves in step with the work queued on that stream, which is why it is the stream’s and not the device’s: the deferred frees a fenced flush releases, the capture window that forbids allocating, the per-launch info buffers a capture may not evict, and the memory the stream’s kernels see.
Required Associated Types§
Sourcetype Fence: Fence + Send + 'static
type Fence: Fence + Send + 'static
The fence this backend records on a stream. Fencing is how the drop queue knows the device is done with what it is holding.
Sourcetype DeviceStorage: ComputeStorage
type DeviceStorage: ComputeStorage
The storage backing the memory this stream’s kernels address.
Sourcetype HostStorage: ComputeStorage
type HostStorage: ComputeStorage
The storage backing the host buffers that stage transfers to it.
Required Methods§
Sourcefn device_memory(&mut self) -> &mut MemoryManagement<Self::DeviceStorage>
fn device_memory(&mut self) -> &mut MemoryManagement<Self::DeviceStorage>
The memory this stream’s kernels see. Allocations are per stream, so a buffer resolves to the stream that created it and nowhere else.
Sourcefn host_memory(&mut self) -> &mut MemoryManagement<Self::HostStorage>
fn host_memory(&mut self) -> &mut MemoryManagement<Self::HostStorage>
The pinned host memory this stream stages transfers through.
Sourcefn drop_queue(&mut self) -> &mut PendingDropQueue<Self::Fence>
fn drop_queue(&mut self) -> &mut PendingDropQueue<Self::Fence>
Frees deferred until the device is known to be done with them.
Sourcefn capturing(&mut self) -> &mut StreamCapture
fn capturing(&mut self) -> &mut StreamCapture
Where this stream sits in the graph-capture lifecycle.
Sourcefn info_cache(&mut self) -> &mut MetadataInfoCache<Handle>
fn info_cache(&mut self) -> &mut MetadataInfoCache<Handle>
The per-launch metadata buffers this stream reuses.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".