pub struct JitKernel { /* private fields */ }Expand description
A compiled C kernel loaded via custom ELF relocator + mmap.
Implementations§
Source§impl JitKernel
impl JitKernel
Sourcepub fn compile(
src: &str,
name: &str,
var_names: Vec<String>,
buf_count: usize,
) -> Result<Self>
pub fn compile( src: &str, name: &str, var_names: Vec<String>, buf_count: usize, ) -> Result<Self>
Compile C source code via clang (stdin→stdout) and load the resulting object file into executable memory.
Sourcepub unsafe fn execute_with_vals(
&self,
buffers: &[*mut u8],
vals: &[i64],
) -> Result<()>
pub unsafe fn execute_with_vals( &self, buffers: &[*mut u8], vals: &[i64], ) -> Result<()>
Execute the kernel with buffer pointers and variable values.
§Safety
Caller must ensure buffer pointers are valid/aligned and vals length
matches var_names.
pub fn fn_ptr(&self) -> *const ()
pub fn name(&self) -> &str
pub fn var_names(&self) -> &[String]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JitKernel
impl RefUnwindSafe for JitKernel
impl Unpin for JitKernel
impl UnsafeUnpin for JitKernel
impl UnwindSafe for JitKernel
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