pub struct CpuLayerExecutor<F>(/* private fields */);
Trait Implementations§
Source§impl<F: TowerTop> ComputeLayerExecutor<F> for CpuLayerExecutor<F>
impl<F: TowerTop> ComputeLayerExecutor<F> for CpuLayerExecutor<F>
Source§type ExprEval = ArithCircuit<F>
type ExprEval = ArithCircuit<F>
The evaluator for arithmetic expressions (polynomials).
Source§type KernelExec = CpuKernelBuilder
type KernelExec = CpuKernelBuilder
The executor that can execute operations on a kernel-level granularity (i.e., a single
core).
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>
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>
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>
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>
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>
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>
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>,
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>
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>
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>
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§impl<F: Debug> Debug for CpuLayerExecutor<F>
impl<F: Debug> Debug for CpuLayerExecutor<F>
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> 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
§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