Skip to main content

SoftGpuQueue

Struct SoftGpuQueue 

Source
pub struct SoftGpuQueue {
    pub handle: PackedHandle,
    pub agent_handle: PackedHandle,
    pub id: u64,
    pub abi: Box<HsaQueueAbi>,
    pub packet_buffer: *mut u8,
    pub packet_bytes: usize,
    pub doorbell: PackedHandle,
    pub write_index: AtomicU64,
    pub read_index: AtomicU64,
    pub doorbell_stores: AtomicU64,
    pub observed_through: AtomicU64,
    /* private fields */
}

Fields§

§handle: PackedHandle§agent_handle: PackedHandle§id: u64§abi: Box<HsaQueueAbi>§packet_buffer: *mut u8§packet_bytes: usize§doorbell: PackedHandle§write_index: AtomicU64§read_index: AtomicU64§doorbell_stores: AtomicU64§observed_through: AtomicU64

SoftGPU observe cursor (mirrors processor progress with read_index in Phase 4).

Implementations§

Source§

impl SoftGpuQueue

Source

pub fn new( handle: PackedHandle, agent_handle: PackedHandle, id: u64, abi: Box<HsaQueueAbi>, packet_buffer: *mut u8, packet_bytes: usize, doorbell: PackedHandle, ) -> Self

Source

pub fn size_packets(&self) -> u64

Source

pub fn write_index(&self) -> u64

Source

pub fn read_index(&self) -> u64

Source

pub fn observed_through(&self) -> u64

Source

pub fn store_write_index(&self, value: u64)

Source

pub fn store_read_index(&self, value: u64)

Source

pub fn note_doorbell_store(&self)

Source

pub fn doorbell_store_count(&self) -> u64

Source

pub fn abi_ptr(&self) -> *mut HsaQueueAbi

Source

pub fn packet_bytes_at( &self, packet_index: u64, ) -> Result<[u8; 64], PacketValidateError>

Source

pub fn write_packet_type(&self, packet_index: u64, packet_type: u16)

Write a packet header type into the ring (test / SoftGPU producer helper).

Source

pub fn write_packet_bytes(&self, packet_index: u64, bytes: &[u8; 64])

Copy full packet bytes into the ring slot (SoftGPU / test producer).

Source

pub fn invalidate_packet_slot(&self, packet_index: u64)

Mark slot INVALID after SoftGPU consumed it (protocol progress).

Source

pub fn observe_packets( &self, ) -> Result<Vec<PacketObservation>, PacketValidateError>

Observe newly submitted packets exactly once. Copies bytes for Phase 4 parse.

Source

pub fn observed_count(&self) -> usize

Trait Implementations§

Source§

impl Debug for SoftGpuQueue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Send for SoftGpuQueue

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.