Skip to main content

StreamBufs

Struct StreamBufs 

Source
pub struct StreamBufs {
    pub vtok_d: CudaSlice<u32>,
    pub brk_d: CudaSlice<u32>,
    pub pend_d: CudaSlice<u32>,
    pub last_pred_d: CudaSlice<u32>,
    pub pos_ctr: CudaSlice<i32>,
    pub pos_start_d: CudaSlice<i32>,
    pub ring_d: CudaSlice<u32>,
    pub acc_d: CudaSlice<u32>,
    pub m_rounds: usize,
    pub k: usize,
}

Fields§

§vtok_d: CudaSlice<u32>

assembled verify tokens [k+1]

§brk_d: CudaSlice<u32>

p-min break markers [2]

§pend_d: CudaSlice<u32>

pending (bonus-fold) token [1]

§last_pred_d: CudaSlice<u32>

last verify prediction [1]

§pos_ctr: CudaSlice<i32>

device position counter (rope/append base)

§pos_start_d: CudaSlice<i32>

round-start position (rollback anchor)

§ring_d: CudaSlice<u32>

committed-token ring [m*(k+1)+1] (slot 0 = count)

§acc_d: CudaSlice<u32>

device accept counters [2]

§m_rounds: usize§k: usize

Implementations§

Source§

impl StreamBufs

Source

pub fn new( e: &Engine, k: usize, m_rounds: usize, ) -> Result<Self, Box<dyn Error>>

Source

pub fn drain_ring(&self, e: &Engine) -> Result<Vec<u32>, Box<dyn Error>>

Drain the ring after a burst (THE one host sync per M rounds): returns the committed tokens in order and resets nothing — the caller zeroes the ring count for the next burst via e.set_u32_one(&mut ring_d, 0).

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.