pub struct CompiledSpec {
pub name: String,
pub src: Option<String>,
pub bytes: Vec<u8>,
pub ast: Arc<UOp>,
pub var_names: Vec<String>,
pub global_size: Option<[usize; 3]>,
pub local_size: Option<[usize; 3]>,
pub buf_count: usize,
}Expand description
Compilation result carrying source (JIT) or bytes (AOT).
Different backends need different information:
- LLVM JIT: needs source code to compile during runtime
- CUDA: needs PTX/CUBIN bytes to load
- Metal: needs metallib bytes to load
This design allows the RuntimeFactory to access whatever it needs without requiring separate code paths for JIT vs AOT backends.
Fields§
§name: StringEntry point function name
src: Option<String>Source code (for JIT backends like LLVM) Set to Some(…) for LLVM JIT, None for AOT backends
bytes: Vec<u8>Compiled bytes (for AOT backends like CUDA/Metal) Empty for LLVM JIT, populated for AOT backends
ast: Arc<UOp>Original AST for cache key construction via hash consing
var_names: Vec<String>Variable names in order for populating vars array at runtime. Includes thread_id at the end if threading is enabled.
global_size: Option<[usize; 3]>Global work size for dispatch (GPU backends, CPU threading) For CPU threading: [thread_count, 1, 1]
local_size: Option<[usize; 3]>Local work size for dispatch (GPU backends)
buf_count: usizeNumber of buffer arguments (for CIF construction at compile time).
Implementations§
Source§impl CompiledSpec
impl CompiledSpec
Trait Implementations§
Source§impl Clone for CompiledSpec
impl Clone for CompiledSpec
Source§fn clone(&self) -> CompiledSpec
fn clone(&self) -> CompiledSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more