Struct CpuLayerExecutor

Source
pub struct CpuLayerExecutor<F>(/* private fields */);

Trait Implementations§

Source§

impl<F: TowerTop> ComputeLayerExecutor<F> for CpuLayerExecutor<F>

Source§

type OpValue = F

The operation (scalar) value type.
Source§

type ExprEval = ArithCircuit<F>

The evaluator for arithmetic expressions (polynomials).
Source§

type KernelExec = CpuKernelBuilder

The executor that can execute operations on a kernel-level granularity (i.e., a single core).
Source§

type DevMem = CpuMemory

The device memory.
Source§

fn accumulate_kernels( &mut self, map: impl Sync + for<'a> Fn(&'a mut Self::KernelExec, usize, Vec<KernelBuffer<'a, F, Self::DevMem>>) -> Result<Vec<F>, Error>, inputs: Vec<KernelMemMap<'_, F, Self::DevMem>>, ) -> Result<Vec<Self::OpValue>, Error>

Launch many kernels in parallel and accumulate the scalar results with field addition. Read more
Source§

fn map_kernels( &mut self, map: impl Sync + for<'a> Fn(&'a mut Self::KernelExec, usize, Vec<KernelBuffer<'a, F, Self::DevMem>>) -> Result<(), Error>, mem_maps: Vec<KernelMemMap<'_, F, Self::DevMem>>, ) -> Result<(), Error>

Launch many kernels in parallel to process buffers without accumulating results. Read more
Source§

fn inner_product<'a>( &'a mut self, a_in: SubfieldSlice<'_, F, Self::DevMem>, b_in: &'a [F], ) -> Result<F, Error>

Returns the inner product of a vector of subfield elements with big field elements. Read more
Source§

fn fold_left( &mut self, mat: SubfieldSlice<'_, F, Self::DevMem>, vec: <Self::DevMem as ComputeMemory<F>>::FSlice<'_>, out: &mut <Self::DevMem as ComputeMemory<F>>::FSliceMut<'_>, ) -> Result<(), Error>

Computes left matrix-vector multiplication of a subfield matrix with a big field vector. Read more
Source§

fn fold_right( &mut self, mat: SubfieldSlice<'_, F, Self::DevMem>, vec: <Self::DevMem as ComputeMemory<F>>::FSlice<'_>, out: &mut <Self::DevMem as ComputeMemory<F>>::FSliceMut<'_>, ) -> Result<(), Error>

Computes right matrix-vector multiplication of a subfield matrix with a big field vector. Read more
Source§

fn tensor_expand( &mut self, log_n: usize, coordinates: &[F], data: &mut &mut [F], ) -> Result<(), Error>

Computes the iterative tensor product of the input with the given coordinates. Read more
Source§

fn fri_fold<FSub>( &mut self, ntt: &(impl AdditiveNTT<FSub> + Sync), log_len: usize, log_batch_size: usize, challenges: &[F], data_in: &[F], data_out: &mut &mut [F], ) -> Result<(), Error>
where FSub: BinaryField, F: ExtensionField<FSub>,

FRI-fold the interleaved codeword using the given challenges. Read more
Source§

fn extrapolate_line( &mut self, evals_0: &mut &mut [F], evals_1: &[F], z: F, ) -> Result<(), Error>

Extrapolates a line between a vector of evaluations at 0 and evaluations at 1. Read more
Source§

fn compute_composite( &mut self, inputs: &SlicesBatch<<Self::DevMem as ComputeMemory<F>>::FSlice<'_>>, output: &mut <Self::DevMem as ComputeMemory<F>>::FSliceMut<'_>, composition: &Self::ExprEval, ) -> Result<(), Error>

Computes the elementwise application of a compiled arithmetic expression to multiple input slices. Read more
Source§

fn pairwise_product_reduce( &mut self, input: <Self::DevMem as ComputeMemory<F>>::FSlice<'_>, round_outputs: &mut [<Self::DevMem as ComputeMemory<F>>::FSliceMut<'_>], ) -> Result<(), Error>

Reduces a slice of elements to a single value by recursively applying pairwise multiplication. Read more
Source§

fn join<Out1: Send, Out2: Send>( &mut self, op1: impl Send + FnOnce(&mut Self) -> Result<Out1, Error>, op2: impl Send + FnOnce(&mut Self) -> Result<Out2, Error>, ) -> Result<(Out1, Out2), Error>

Creates an operation that depends on the concurrent execution of two inner operations.
Source§

fn map<Out: Send, I: ExactSizeIterator<Item: Send> + Send>( &mut self, iter: I, map: impl Sync + Fn(&mut Self, I::Item) -> Result<Out, Error>, ) -> Result<Vec<Out>, Error>

Creates an operation that depends on the concurrent execution of a sequence of operations.
Source§

impl<F: Debug> Debug for CpuLayerExecutor<F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F> Default for CpuLayerExecutor<F>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<F> Freeze for CpuLayerExecutor<F>

§

impl<F> RefUnwindSafe for CpuLayerExecutor<F>
where F: RefUnwindSafe,

§

impl<F> Send for CpuLayerExecutor<F>
where F: Send,

§

impl<F> Sync for CpuLayerExecutor<F>
where F: Sync,

§

impl<F> Unpin for CpuLayerExecutor<F>
where F: Unpin,

§

impl<F> UnwindSafe for CpuLayerExecutor<F>
where F: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more