pub struct NeighborsLastMultiThread<DC> {
pub domain_context: DC,
pub log_base_len: usize,
pub log_num_shares: usize,
}
Expand description
A multi-threaded implementation of AdditiveNTT
.
The code only makes sure that it’s fast for a large data input. For small inputs, it can be comparatively slow!
The implementation is depth-first, but calls a breadth-first implementation as a base case.
Note that “neighbors last” refers to the memory layout for the NTT: In the last layer of this NTT algorithm, neighboring elements speak to each other. In the classic FFT that’s usually the case for “decimation in frequency”.
Fields§
§domain_context: DC
The domain context from which the twiddles are pulled.
log_base_len: usize
Determines when to switch from depth-first to the breadth-first base case.
The base-2 logarithm of number of equal-sized shares that the problem should be split into. Each share needs to do the same amount of work. If you have equally powered cores available, this should be the base-2 logarithm of the number of cores.
Implementations§
Trait Implementations§
Source§impl<DC: DomainContext + Sync> AdditiveNTT for NeighborsLastMultiThread<DC>
impl<DC: DomainContext + Sync> AdditiveNTT for NeighborsLastMultiThread<DC>
type Field = <DC as DomainContext>::Field
Source§fn forward_transform<P: PackedField<Scalar = Self::Field>>(
&self,
data_orig: FieldSliceMut<'_, P>,
skip_early: usize,
skip_late: usize,
)
fn forward_transform<P: PackedField<Scalar = Self::Field>>( &self, data_orig: FieldSliceMut<'_, P>, skip_early: usize, skip_late: usize, )
Source§fn inverse_transform<P: PackedField<Scalar = Self::Field>>(
&self,
_data_orig: FieldSliceMut<'_, P>,
_skip_early: usize,
_skip_late: usize,
)
fn inverse_transform<P: PackedField<Scalar = Self::Field>>( &self, _data_orig: FieldSliceMut<'_, P>, _skip_early: usize, _skip_late: usize, )
Self::forward_transform
. Read moreSource§fn domain_context(&self) -> &impl DomainContext<Field = DC::Field>
fn domain_context(&self) -> &impl DomainContext<Field = DC::Field>
DomainContext
.Source§fn log_domain_size(&self) -> usize
fn log_domain_size(&self) -> usize
Auto Trait Implementations§
impl<DC> Freeze for NeighborsLastMultiThread<DC>where
DC: Freeze,
impl<DC> RefUnwindSafe for NeighborsLastMultiThread<DC>where
DC: RefUnwindSafe,
impl<DC> Send for NeighborsLastMultiThread<DC>where
DC: Send,
impl<DC> Sync for NeighborsLastMultiThread<DC>where
DC: Sync,
impl<DC> Unpin for NeighborsLastMultiThread<DC>where
DC: Unpin,
impl<DC> UnwindSafe for NeighborsLastMultiThread<DC>where
DC: UnwindSafe,
Blanket Implementations§
§impl<T> AsMaybeUninit for T
impl<T> AsMaybeUninit for T
§type Uninit = MaybeUninit<T>
type Uninit = MaybeUninit<T>
§fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit
fn as_ref_uninit(&self) -> &<T as AsMaybeUninit>::Uninit
&self
to its maybe-initialized equivalent.§unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit
unsafe fn as_mut_uninit(&mut self) -> &mut <T as AsMaybeUninit>::Uninit
&mut T
to its maybe-initialized equivalent. Read more§unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit
unsafe fn raw_as_uninit<'a>(raw: *const T) -> &'a <T as AsMaybeUninit>::Uninit
§unsafe fn raw_mut_as_uninit<'a>(
raw: *mut T,
) -> &'a mut <T as AsMaybeUninit>::Uninit
unsafe fn raw_mut_as_uninit<'a>( raw: *mut T, ) -> &'a mut <T as AsMaybeUninit>::Uninit
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
§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>
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>
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