pub struct Runtime { /* private fields */ }Expand description
SoftGPU runtime state.
Implementations§
Source§impl Runtime
impl Runtime
pub fn new(profile: DeviceProfile) -> Result<Self, Error>
Sourcepub fn register_isa_kernel(
&mut self,
name: impl Into<String>,
code: Vec<u8>,
) -> Result<u64, RuntimeError>
pub fn register_isa_kernel( &mut self, name: impl Into<String>, code: Vec<u8>, ) -> Result<u64, RuntimeError>
Register a SoftGPU ISA kernel; returns kernel_object id for AQL packets.
Sourcepub fn register_isa_kernel_ex(
&mut self,
name: impl Into<String>,
code: Vec<u8>,
kernarg_segment_size: u32,
group_segment_size: u32,
private_segment_size: u32,
) -> Result<u64, RuntimeError>
pub fn register_isa_kernel_ex( &mut self, name: impl Into<String>, code: Vec<u8>, kernarg_segment_size: u32, group_segment_size: u32, private_segment_size: u32, ) -> Result<u64, RuntimeError>
Register ISA kernel with segment sizes (HSA symbol_get_info).
Sourcepub fn register_builtin_tiny_add(&mut self) -> Result<u64, RuntimeError>
pub fn register_builtin_tiny_add(&mut self) -> Result<u64, RuntimeError>
Register the SoftGPU llvm-mc tiny_add kernel image.
pub fn lookup_isa_kernel( &self, kernel_object: u64, ) -> Option<&RegisteredIsaKernel>
pub fn code_object_reader_create_from_memory( &mut self, bytes: &[u8], ) -> Result<u64, RuntimeError>
pub fn code_object_reader_destroy( &mut self, reader_id: u64, ) -> Result<(), RuntimeError>
pub fn executable_create(&mut self) -> Result<u64, RuntimeError>
pub fn executable_destroy(&mut self, exec_id: u64) -> Result<(), RuntimeError>
pub fn executable_load_agent_code_object( &mut self, exec_id: u64, reader_id: u64, ) -> Result<(), RuntimeError>
pub fn executable_freeze(&mut self, exec_id: u64) -> Result<(), RuntimeError>
pub fn executable_get_symbol_by_name( &mut self, exec_id: u64, name: &str, ) -> Result<u64, RuntimeError>
pub fn executable_symbol_kernel_object( &self, symbol_id: u64, ) -> Result<u64, RuntimeError>
pub fn executable_symbol_info( &self, symbol_id: u64, ) -> Result<&ExecutableSymbol, RuntimeError>
pub fn executable_is_frozen(&self, exec_id: u64) -> Result<bool, RuntimeError>
Sourcepub fn dispatch_captures(&self) -> &[DispatchDescriptor]
pub fn dispatch_captures(&self) -> &[DispatchDescriptor]
Owned packet captures suitable for offline aql::replay_dispatch.
pub fn profile(&self) -> &DeviceProfile
pub fn trace_snapshot(&self) -> Vec<TraceEvent>
pub fn init(&mut self) -> Result<(), RuntimeError>
pub fn shut_down(&mut self) -> Result<(), RuntimeError>
pub fn is_initialized(&self) -> bool
pub fn iterate_agents<F>(&self, callback: F) -> Result<(), RuntimeError>
pub fn agent_get_info( &self, handle: PackedHandle, attr: AgentInfoAttr, ) -> Result<AgentInfoValue, RuntimeError>
pub fn iterate_regions<F>( &self, agent: PackedHandle, callback: F, ) -> Result<(), RuntimeError>
pub fn iterate_pools<F>( &self, agent: PackedHandle, callback: F, ) -> Result<(), RuntimeError>
pub fn region_get_info( &self, handle: PackedHandle, attr: RegionInfoAttr, ) -> Result<RegionInfoValue, RuntimeError>
pub fn pool_get_info( &self, handle: PackedHandle, attr: PoolInfoAttr, ) -> Result<PoolInfoValue, RuntimeError>
pub fn memory_allocate( &mut self, space_handle: PackedHandle, size: usize, ) -> Result<*mut u8, RuntimeError>
pub fn memory_free(&mut self, ptr: *mut u8) -> Result<(), RuntimeError>
pub fn allocation_lookup( &self, ptr: *const u8, ) -> Result<AllocationMeta, RuntimeError>
Sourcepub unsafe fn memory_copy(
&self,
dst: *mut u8,
src: *const u8,
size: usize,
) -> Result<(), RuntimeError>
pub unsafe fn memory_copy( &self, dst: *mut u8, src: *const u8, size: usize, ) -> Result<(), RuntimeError>
§Safety
dst and src must be valid for size bytes; SoftGPU does not
validate OS-mapped pointers beyond SoftGPU allocations.
pub fn agents_allow_access( &self, agents: &[PackedHandle], _ptr: *const u8, ) -> Result<(), RuntimeError>
pub fn agent_memory_pool_access( &self, agent: PackedHandle, pool: PackedHandle, ) -> Result<u32, RuntimeError>
pub fn signal_create( &mut self, initial: i64, ) -> Result<PackedHandle, RuntimeError>
pub fn signal_destroy( &mut self, handle: PackedHandle, ) -> Result<(), RuntimeError>
pub fn signal_load(&self, handle: PackedHandle) -> Result<i64, RuntimeError>
pub fn signal_store( &mut self, handle: PackedHandle, value: i64, ) -> Result<(), RuntimeError>
Sourcepub fn signal_arc(
&self,
handle: PackedHandle,
) -> Result<Arc<SoftGpuSignal>, RuntimeError>
pub fn signal_arc( &self, handle: PackedHandle, ) -> Result<Arc<SoftGpuSignal>, RuntimeError>
Clone the signal Arc for waiting without holding the runtime lock.
pub fn signal_wait( &self, handle: PackedHandle, condition: u32, compare: i64, timeout_hint_ns: u64, wait_state_hint: u32, ) -> Result<SignalWaitOutcome, RuntimeError>
Sourcepub fn queue_observe(
&self,
abi: *const HsaQueueAbi,
) -> Result<Vec<PacketObservation>, RuntimeError>
pub fn queue_observe( &self, abi: *const HsaQueueAbi, ) -> Result<Vec<PacketObservation>, RuntimeError>
SoftGPU packet observation without doorbell (test / tooling).
pub fn queue_create( &mut self, agent: PackedHandle, size: u32, type_: u32, ) -> Result<*mut HsaQueueAbi, RuntimeError>
pub fn queue_destroy( &mut self, abi: *mut HsaQueueAbi, ) -> Result<(), RuntimeError>
pub fn queue_load_write_index( &self, abi: *const HsaQueueAbi, ) -> Result<u64, RuntimeError>
pub fn queue_load_read_index( &self, abi: *const HsaQueueAbi, ) -> Result<u64, RuntimeError>
pub fn queue_store_write_index( &self, abi: *const HsaQueueAbi, value: u64, ) -> Result<(), RuntimeError>
pub fn queue_store_read_index( &self, abi: *const HsaQueueAbi, value: u64, ) -> Result<(), RuntimeError>
pub fn queue_doorbell_count( &self, abi: *const HsaQueueAbi, ) -> Result<u64, RuntimeError>
pub fn record_unsupported(&self, api: &str, detail: &str)
pub fn max_fidelity(&self) -> FidelityLevel
Auto Trait Implementations§
impl !Freeze for Runtime
impl !Sync for Runtime
impl RefUnwindSafe for Runtime
impl Send for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
impl UnwindSafe for Runtime
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