pub struct Device { /* private fields */ }Implementations§
Source§impl Device
impl Device
pub fn new_simulated(id: u64, props: DeviceProperties) -> Self
Sourcepub fn open() -> TptrResult<Self>
pub fn open() -> TptrResult<Self>
Open the best available real device backend, falling back to a simulated
device when none is present. Mirrors VendorBackend::detect() but at the
tpt-gpu-runtime::Device level (currently CUDA only).
pub fn handle(&self) -> DeviceHandle
pub fn info(&self) -> &DeviceInfo
pub fn properties(&self) -> &DeviceProperties
pub fn allocate( &mut self, size: u64, region: MemoryRegion, mem_type: MemType, access: MemAccess, ) -> TptrResult<MemoryAllocation>
pub fn free(&mut self, allocation: &MemoryAllocation) -> TptrResult<()>
pub fn allocator_stats(&self) -> AllocatorStats
pub fn memcpy_htod( &self, dst: &MemoryAllocation, src: &[u8], size: u64, dst_offset: u64, ) -> TptrResult<()>
pub fn memcpy_dtoh( &self, dst: &mut [u8], src: &MemoryAllocation, size: u64, src_offset: u64, ) -> TptrResult<()>
pub fn create_queue( &mut self, _priority: QueuePriority, capacity: usize, ) -> QueueHandle
pub fn submit( &mut self, queue: QueueHandle, command: Command, priority: QueuePriority, ) -> TptrResult<u64>
pub fn scheduler_mut(&mut self) -> &mut CommandScheduler
pub fn create_kernel(&self, name: &str) -> Kernel
Sourcepub fn load_module(&self, tptir_text: &str) -> TptrResult<Kernel>
pub fn load_module(&self, tptir_text: &str) -> TptrResult<Kernel>
Load a TPTIR text module and compile it into a runnable Kernel.
This is the external-integration entry point: callers pass TPTIR
assembly (e.g. emitted by tpt-archon) and receive a Kernel whose
compiled code is stored on the handle so that launch_kernel can
dispatch against it. Compilation uses layer3_tptc’s
compile_native (the tpt-gpu-compiler crate).
pub fn launch_kernel( &self, kernel: &Kernel, config: &KernelConfig, args: &[Vec<u8>], ) -> KernelHandle
pub fn synchronize(&mut self)
pub fn pending_commands(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Device
impl !RefUnwindSafe for Device
impl !UnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl UnsafeUnpin for Device
Blanket Implementations§
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