Skip to main content

JitCompiler

Struct JitCompiler 

Source
pub struct JitCompiler { /* private fields */ }
Expand description

JIT WGSL compiler for kernel fusion

Phase 1 MVP: Template-based code generation for common patterns. Future: Full SQL AST → WGSL compilation in Phase 2.

Implementations§

Source§

impl JitCompiler

Source

pub fn new() -> Self

Create a new JIT compiler with shader cache

Source

pub fn generate_fused_filter_sum( &self, filter_threshold: i32, filter_op: &str, ) -> String

Generate fused filter+sum kernel

Fuses WHERE clause with SUM aggregation in single GPU pass.

§Arguments
  • filter_threshold - Threshold value for filter (e.g., WHERE value > 1000)
  • filter_op - Filter operator (“gt”, “lt”, “eq”, “gte”, “lte”)
§Returns

WGSL shader source code for fused kernel

§Example
let shader = compiler.generate_fused_filter_sum(1000, "gt");
// Generates: WHERE value > 1000, SUM(value) in single pass
Source

pub fn compile_fused_filter_sum( &self, device: &Device, filter_threshold: i32, filter_op: &str, ) -> Arc<ShaderModule>

Compile and cache fused filter+sum kernel

§Arguments
  • device - GPU device for compilation
  • filter_threshold - Filter threshold value
  • filter_op - Filter operator
§Returns

Arc reference to compiled shader module (cached for reuse)

Source

pub fn cache_stats(&self) -> (usize, usize)

Get cache statistics (size, capacity)

Trait Implementations§

Source§

impl Default for JitCompiler

Source§

fn default() -> Self

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

Auto Trait Implementations§

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,