pub struct SqrtHyperBuffer {
pub low: DeviceBuffer<EF>,
pub high: DeviceBuffer<EF>,
pub low_capacity: usize,
pub size: usize,
}Expand description
Square-root decomposition of hypercube equality buffer for memory optimization.
Instead of storing a single buffer of size 2^n, we store two buffers of size 2^(n/2), reducing memory usage from O(2^n) to O(2*2^(n/2)). The full value at index i is computed on-the-fly as: low[i % low_cap] * high[i / low_cap]
Fields§
§low: DeviceBuffer<EF>§high: DeviceBuffer<EF>§low_capacity: usize§size: usizeImplementations§
Source§impl SqrtHyperBuffer
impl SqrtHyperBuffer
Sourcepub fn from_xi(
xi: &[EF],
device_ctx: &GpuDeviceCtx,
) -> Result<Self, KernelError>
pub fn from_xi( xi: &[EF], device_ctx: &GpuDeviceCtx, ) -> Result<Self, KernelError>
Build a buffer from xi. Note that last elements of xi correspond to the lowest index
bits.
pub fn fold_columns( &mut self, r: EF, device_ctx: &GpuDeviceCtx, ) -> Result<(), CudaError>
Auto Trait Implementations§
impl Freeze for SqrtHyperBuffer
impl RefUnwindSafe for SqrtHyperBuffer
impl Send for SqrtHyperBuffer
impl Sync for SqrtHyperBuffer
impl Unpin for SqrtHyperBuffer
impl UnsafeUnpin for SqrtHyperBuffer
impl UnwindSafe for SqrtHyperBuffer
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more