Struct binius_hal::CpuBackend
source · pub struct CpuBackend;
Expand description
Implementation of ComputationBackend for the default Backend that uses the CPU for all computations.
Trait Implementations§
source§impl Clone for CpuBackend
impl Clone for CpuBackend
source§fn clone(&self) -> CpuBackend
fn clone(&self) -> CpuBackend
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ComputationBackend for CpuBackend
impl ComputationBackend for CpuBackend
type Vec<P: Send + Sync + Debug + 'static> = Vec<P>
source§fn to_hal_slice<P: Debug + Send + Sync + 'static>(v: Vec<P>) -> Self::Vec<P>
fn to_hal_slice<P: Debug + Send + Sync + 'static>(v: Vec<P>) -> Self::Vec<P>
Creates
Self::Vec<P>
from the given Vec<P>
.source§fn tensor_product_full_query<P: PackedField>(
&self,
query: &[P::Scalar]
) -> Result<Self::Vec<P>, Error>
fn tensor_product_full_query<P: PackedField>( &self, query: &[P::Scalar] ) -> Result<Self::Vec<P>, Error>
Computes tensor product expansion.
source§fn zerocheck_compute_round_coeffs<F, PW, FDomain>(
&self,
params: &ZerocheckRoundParameters,
input: &ZerocheckRoundInput<'_, F, PW, FDomain>,
handler: &mut dyn ZerocheckCpuBackendHelper<F, PW, FDomain>
) -> Result<Vec<PW::Scalar>, Error>
fn zerocheck_compute_round_coeffs<F, PW, FDomain>( &self, params: &ZerocheckRoundParameters, input: &ZerocheckRoundInput<'_, F, PW, FDomain>, handler: &mut dyn ZerocheckCpuBackendHelper<F, PW, FDomain> ) -> Result<Vec<PW::Scalar>, Error>
Computes round coefficients for zerocheck.
cpu_handler
is a callback to handle the CpuBackend computation.
It’s a leaky abstraction, but zerocheck is too complex to refactor for a clean abstraction separation just yet.Auto Trait Implementations§
impl Freeze for CpuBackend
impl RefUnwindSafe for CpuBackend
impl Send for CpuBackend
impl Sync for CpuBackend
impl Unpin for CpuBackend
impl UnwindSafe for CpuBackend
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<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