use crate::graph::CpuGraph;
use tl_backend::stream::GpuStream;
pub struct CpuStream {
capturing: Option<CpuGraph>,
}
impl CpuStream {
pub fn new() -> Self {
CpuStream { capturing: None }
}
}
impl GpuStream for CpuStream {
type Graph = CpuGraph;
fn synchronize(&mut self) {
}
fn needs_sync(&self) -> bool {
false }
fn begin_capture(&mut self) {
self.capturing = Some(CpuGraph::new());
}
fn end_capture(&mut self) -> CpuGraph {
self.capturing.take()
.expect("end_capture called without begin_capture")
}
fn is_capturing(&self) -> bool {
self.capturing.is_some()
}
}