binius_hal

Trait ComputationBackend

source
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§

source

type Vec<P: Send + Sync + Debug + 'static>: HalSlice<P>

Required Methods§

source

fn to_hal_slice<P: Debug + Send + Sync>(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>

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>,

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>,

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>

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
where &'a T: Debug + Sync + Send,

Makes it unnecessary to clone backends. Can’t use auto_impl because of the complex associated type.

source§

type Vec<P: Send + Sync + Debug + 'static> = <T as ComputationBackend>::Vec<P>

source§

fn to_hal_slice<P: Debug + Send + Sync>(v: Vec<P>) -> Self::Vec<P>

source§

fn tensor_product_full_query<P: PackedField>( &self, query: &[P::Scalar], ) -> Result<Self::Vec<P>, Error>

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>,

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>,

source§

fn evaluate_partial_high<P: PackedField>( &self, multilinear: &impl MultilinearPoly<P>, query_expansion: MultilinearQueryRef<'_, P>, ) -> Result<MultilinearExtension<P>, Error>

Implementors§

source§

impl ComputationBackend for CpuBackend

source§

type Vec<P: Send + Sync + Debug + 'static> = Vec<P>