pub trait ComputationBackend:
Send
+ Sync
+ Debug {
type Vec<P: Send + Sync + Debug + 'static>: HalSlice<P>;
// Required methods
fn to_hal_slice<P: Debug + Send + Sync>(v: Vec<P>) -> Self::Vec<P>;
fn tensor_product_full_query<P: PackedField>(
&self,
query: &[P::Scalar],
) -> Result<Self::Vec<P>, Error>;
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_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 evaluate_partial_high<P: PackedField>(
&self,
multilinear: &impl MultilinearPoly<P>,
query_expansion: MultilinearQueryRef<'_, P>,
) -> Result<MultilinearExtension<P>, Error>;
}
Expand description
An abstraction to interface with acceleration hardware to perform computation intensive operations.
Required Associated Types§
Required Methods§
sourcefn to_hal_slice<P: Debug + Send + Sync>(v: Vec<P>) -> Self::Vec<P>
fn to_hal_slice<P: Debug + Send + Sync>(v: Vec<P>) -> Self::Vec<P>
Creates Self::Vec<P>
from the given Vec<P>
.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl<'a, T: 'a + ComputationBackend> ComputationBackend for &'a T
impl<'a, T: 'a + ComputationBackend> ComputationBackend for &'a T
Makes it unnecessary to clone backends.
Can’t use auto_impl
because of the complex associated type.