Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime { /* private fields */ }
Expand description

SoftGPU runtime state.

Implementations§

Source§

impl Runtime

Source

pub fn new(profile: DeviceProfile) -> Result<Self, Error>

Source

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.

Source

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).

Source

pub fn register_builtin_tiny_add(&mut self) -> Result<u64, RuntimeError>

Register the SoftGPU llvm-mc tiny_add kernel image.

Source

pub fn lookup_isa_kernel( &self, kernel_object: u64, ) -> Option<&RegisteredIsaKernel>

Source

pub fn code_object_reader_create_from_memory( &mut self, bytes: &[u8], ) -> Result<u64, RuntimeError>

Source

pub fn code_object_reader_destroy( &mut self, reader_id: u64, ) -> Result<(), RuntimeError>

Source

pub fn executable_create(&mut self) -> Result<u64, RuntimeError>

Source

pub fn executable_destroy(&mut self, exec_id: u64) -> Result<(), RuntimeError>

Source

pub fn executable_load_agent_code_object( &mut self, exec_id: u64, reader_id: u64, ) -> Result<(), RuntimeError>

Source

pub fn executable_freeze(&mut self, exec_id: u64) -> Result<(), RuntimeError>

Source

pub fn executable_get_symbol_by_name( &mut self, exec_id: u64, name: &str, ) -> Result<u64, RuntimeError>

Source

pub fn executable_symbol_kernel_object( &self, symbol_id: u64, ) -> Result<u64, RuntimeError>

Source

pub fn executable_symbol_info( &self, symbol_id: u64, ) -> Result<&ExecutableSymbol, RuntimeError>

Source

pub fn executable_is_frozen(&self, exec_id: u64) -> Result<bool, RuntimeError>

Source

pub fn dispatch_captures(&self) -> &[DispatchDescriptor]

Owned packet captures suitable for offline aql::replay_dispatch.

Source

pub fn profile(&self) -> &DeviceProfile

Source

pub fn trace_snapshot(&self) -> Vec<TraceEvent>

Source

pub fn init(&mut self) -> Result<(), RuntimeError>

Source

pub fn shut_down(&mut self) -> Result<(), RuntimeError>

Source

pub fn is_initialized(&self) -> bool

Source

pub fn iterate_agents<F>(&self, callback: F) -> Result<(), RuntimeError>

Source

pub fn agent_get_info( &self, handle: PackedHandle, attr: AgentInfoAttr, ) -> Result<AgentInfoValue, RuntimeError>

Source

pub fn iterate_regions<F>( &self, agent: PackedHandle, callback: F, ) -> Result<(), RuntimeError>

Source

pub fn iterate_pools<F>( &self, agent: PackedHandle, callback: F, ) -> Result<(), RuntimeError>

Source

pub fn region_get_info( &self, handle: PackedHandle, attr: RegionInfoAttr, ) -> Result<RegionInfoValue, RuntimeError>

Source

pub fn pool_get_info( &self, handle: PackedHandle, attr: PoolInfoAttr, ) -> Result<PoolInfoValue, RuntimeError>

Source

pub fn memory_allocate( &mut self, space_handle: PackedHandle, size: usize, ) -> Result<*mut u8, RuntimeError>

Source

pub fn memory_free(&mut self, ptr: *mut u8) -> Result<(), RuntimeError>

Source

pub fn allocation_lookup( &self, ptr: *const u8, ) -> Result<AllocationMeta, RuntimeError>

Source

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.

Source

pub fn agents_allow_access( &self, agents: &[PackedHandle], _ptr: *const u8, ) -> Result<(), RuntimeError>

Source

pub fn agent_memory_pool_access( &self, agent: PackedHandle, pool: PackedHandle, ) -> Result<u32, RuntimeError>

Source

pub fn signal_create( &mut self, initial: i64, ) -> Result<PackedHandle, RuntimeError>

Source

pub fn signal_destroy( &mut self, handle: PackedHandle, ) -> Result<(), RuntimeError>

Source

pub fn signal_load(&self, handle: PackedHandle) -> Result<i64, RuntimeError>

Source

pub fn signal_store( &mut self, handle: PackedHandle, value: i64, ) -> Result<(), RuntimeError>

Source

pub fn signal_arc( &self, handle: PackedHandle, ) -> Result<Arc<SoftGpuSignal>, RuntimeError>

Clone the signal Arc for waiting without holding the runtime lock.

Source

pub fn signal_wait( &self, handle: PackedHandle, condition: u32, compare: i64, timeout_hint_ns: u64, wait_state_hint: u32, ) -> Result<SignalWaitOutcome, RuntimeError>

Source

pub fn queue_observe( &self, abi: *const HsaQueueAbi, ) -> Result<Vec<PacketObservation>, RuntimeError>

SoftGPU packet observation without doorbell (test / tooling).

Source

pub fn queue_create( &mut self, agent: PackedHandle, size: u32, type_: u32, ) -> Result<*mut HsaQueueAbi, RuntimeError>

Source

pub fn queue_destroy( &mut self, abi: *mut HsaQueueAbi, ) -> Result<(), RuntimeError>

Source

pub fn queue_load_write_index( &self, abi: *const HsaQueueAbi, ) -> Result<u64, RuntimeError>

Source

pub fn queue_load_read_index( &self, abi: *const HsaQueueAbi, ) -> Result<u64, RuntimeError>

Source

pub fn queue_store_write_index( &self, abi: *const HsaQueueAbi, value: u64, ) -> Result<(), RuntimeError>

Source

pub fn queue_store_read_index( &self, abi: *const HsaQueueAbi, value: u64, ) -> Result<(), RuntimeError>

Source

pub fn queue_doorbell_count( &self, abi: *const HsaQueueAbi, ) -> Result<u64, RuntimeError>

Source

pub fn record_unsupported(&self, api: &str, detail: &str)

Source

pub fn max_fidelity(&self) -> FidelityLevel

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.