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.6.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.
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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