pub struct DenseKernel { /* private fields */ }Expand description
The dense simulation kernel - zero-allocation hot loop.
This kernel is designed for maximum throughput (>10M ticks/sec) by:
- Using zero-copy data access
- Operating on raw memory via
AccessPolicy - Avoiding allocations in the hot loop
Implementations§
Source§impl DenseKernel
impl DenseKernel
Sourcepub fn new(config: DenseKernelConfig) -> Self
pub fn new(config: DenseKernelConfig) -> Self
Create a new dense kernel with the given configuration.
Sourcepub fn run<S, F>(
&self,
data: &DataTable,
initial_state: S,
strategy: F,
) -> Result<DenseKernelResult<S>>
pub fn run<S, F>( &self, data: &DataTable, initial_state: S, strategy: F, ) -> Result<DenseKernelResult<S>>
Run simulation on a DataTable with a closure-based strategy.
Extracts f64 column pointers from the DataTable and iterates
effective_start..config.end, calling the strategy each tick.
Sourcepub unsafe fn run_jit(
&self,
column_ptrs: &[*const f64],
state_ptr: *mut u8,
kernel: SimulationKernelFn,
) -> Result<DenseKernelResult<()>>
pub unsafe fn run_jit( &self, column_ptrs: &[*const f64], state_ptr: *mut u8, kernel: SimulationKernelFn, ) -> Result<DenseKernelResult<()>>
Run simulation with JIT-compiled kernel function.
This is the highest-performance path - bypasses SeriesCursor and calls the kernel directly with raw pointers.
§Arguments
column_ptrs- Slice of column data pointersstate_ptr- Mutable pointer to state buffer (TypedObject)kernel- JIT-compiled kernel function
§Returns
Result containing execution statistics (state is modified in-place).
§Safety
The column_ptrs must point to valid f64 arrays with length >= self.config.end. The state_ptr must point to a valid TypedObject buffer.
Auto Trait Implementations§
impl Freeze for DenseKernel
impl RefUnwindSafe for DenseKernel
impl Send for DenseKernel
impl Sync for DenseKernel
impl Unpin for DenseKernel
impl UnsafeUnpin for DenseKernel
impl UnwindSafe for DenseKernel
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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