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 sumcheck_compute_first_round_evals<FDomain, FBase, F, PBase, P, M, Evaluator, Composition>(
&self,
n_vars: usize,
multilinears: &[SumcheckMultilinear<P, M>],
evaluators: &[Evaluator],
evaluation_points: &[FDomain],
) -> Result<Vec<RoundEvals<P::Scalar>>, Error>where
FDomain: Field,
FBase: ExtensionField<FDomain>,
F: Field + ExtensionField<FDomain> + ExtensionField<FBase>,
PBase: PackedField<Scalar = FBase> + PackedExtension<FDomain>,
P: PackedField<Scalar = F> + PackedExtension<FDomain> + RepackedExtension<PBase>,
M: MultilinearPoly<P> + Send + Sync,
Evaluator: SumcheckEvaluator<PBase, P, Composition> + Sync,
Composition: CompositionPolyOS<P>,
fn sumcheck_compute_first_round_evals<FDomain, FBase, F, PBase, P, M, Evaluator, Composition>(
&self,
n_vars: usize,
multilinears: &[SumcheckMultilinear<P, M>],
evaluators: &[Evaluator],
evaluation_points: &[FDomain],
) -> Result<Vec<RoundEvals<P::Scalar>>, Error>where
FDomain: Field,
FBase: ExtensionField<FDomain>,
F: Field + ExtensionField<FDomain> + ExtensionField<FBase>,
PBase: PackedField<Scalar = FBase> + PackedExtension<FDomain>,
P: PackedField<Scalar = F> + PackedExtension<FDomain> + RepackedExtension<PBase>,
M: MultilinearPoly<P> + Send + Sync,
Evaluator: SumcheckEvaluator<PBase, P, Composition> + Sync,
Composition: CompositionPolyOS<P>,
Calculate the accumulated evaluations for the first round of zerocheck.
Source§fn sumcheck_compute_later_round_evals<FDomain, F, P, M, Evaluator, Composition>(
&self,
n_vars: usize,
tensor_query: Option<MultilinearQueryRef<'_, P>>,
multilinears: &[SumcheckMultilinear<P, M>],
evaluators: &[Evaluator],
evaluation_points: &[FDomain],
) -> Result<Vec<RoundEvals<P::Scalar>>, Error>where
FDomain: Field,
F: Field + ExtensionField<FDomain>,
P: PackedField<Scalar = F> + PackedExtension<FDomain>,
M: MultilinearPoly<P> + Send + Sync,
Evaluator: SumcheckEvaluator<P, P, Composition> + Sync,
Composition: CompositionPolyOS<P>,
fn sumcheck_compute_later_round_evals<FDomain, F, P, M, Evaluator, Composition>(
&self,
n_vars: usize,
tensor_query: Option<MultilinearQueryRef<'_, P>>,
multilinears: &[SumcheckMultilinear<P, M>],
evaluators: &[Evaluator],
evaluation_points: &[FDomain],
) -> Result<Vec<RoundEvals<P::Scalar>>, Error>where
FDomain: Field,
F: Field + ExtensionField<FDomain>,
P: PackedField<Scalar = F> + PackedExtension<FDomain>,
M: MultilinearPoly<P> + Send + Sync,
Evaluator: SumcheckEvaluator<P, P, Composition> + Sync,
Composition: CompositionPolyOS<P>,
Calculate the accumulated evaluations for an arbitrary round of zerocheck.
Source§fn evaluate_partial_high<P: PackedField>(
&self,
multilinear: &impl MultilinearPoly<P>,
query_expansion: MultilinearQueryRef<'_, P>,
) -> Result<MultilinearExtension<P>, Error>
fn evaluate_partial_high<P: PackedField>( &self, multilinear: &impl MultilinearPoly<P>, query_expansion: MultilinearQueryRef<'_, P>, ) -> Result<MultilinearExtension<P>, Error>
Partially evaluate the polynomial with assignment to the high-indexed variables.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Backend> ComputationBackendExt for Backendwhere
Backend: ComputationBackend,
impl<Backend> ComputationBackendExt for Backendwhere
Backend: ComputationBackend,
Source§fn multilinear_query<P: PackedField>(
&self,
query: &[P::Scalar],
) -> Result<MultilinearQuery<P, Self::Vec<P>>, Error>
fn multilinear_query<P: PackedField>( &self, query: &[P::Scalar], ) -> Result<MultilinearQuery<P, Self::Vec<P>>, Error>
Constructs a
MultilinearQuery
by performing tensor product expansion on the given query
.§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