Skip to main content

CompileOptions

Struct CompileOptions 

Source
pub struct CompileOptions {
    pub precision: Precision,
    pub policy: Option<PrecisionPolicy>,
    pub dce: bool,
    pub constant_folding: bool,
    pub verbose: bool,
    pub fusion_target: Option<FusionTarget>,
    pub fusion_opts: FusionOptions,
    pub arena_alignment: usize,
    pub assert_fusion_clean: bool,
    pub supported_ops: Option<&'static [OpKind]>,
    pub dim_binding: Option<DimBinding>,
    pub kernel_dispatch: KernelDispatchConfig,
}
Expand description

All knobs the compile pipeline understands. Add new fields here rather than introducing new compile entry points.

Fields§

§precision: Precision

Target numeric precision for execution. Default: F32.

§policy: Option<PrecisionPolicy>

Optional per-op precision policy (mixed precision rewrite).

§dce: bool

Run dead-code elimination as part of compile. Default: true.

§constant_folding: bool

Run constant folding. Default: true (cheap, only helps).

§verbose: bool

Verbose pass logging. Equivalent to RLX_VERBOSE=1 or [rlx_ir::env::set("RLX_VERBOSE", "1")].

§fusion_target: Option<FusionTarget>

Override fusion pipeline target (default: inferred from device).

§fusion_opts: FusionOptions

Per-target fusion toggles (Metal env overrides, skip fusion, …).

§arena_alignment: usize

Arena alignment for buffer planning. Default: 64.

§assert_fusion_clean: bool

Panic at compile time if fusion diagnostics report missed patterns.

§supported_ops: Option<&'static [OpKind]>

Backend op claim set for backend-aware fusion + post-fusion legalization. Set by [Backend::compile] implementations.

§dim_binding: Option<DimBinding>

When set, specialize symbolic dims before backend lowering.

§kernel_dispatch: KernelDispatchConfig

Native vs common IR lowering (KernelDispatchConfig, RLX_KERNEL_DISPATCH=common).

Implementations§

Source§

impl CompileOptions

Source

pub fn new() -> Self

Source

pub fn precision(self, p: Precision) -> Self

Source

pub fn policy(self, p: PrecisionPolicy) -> Self

Source

pub fn no_policy(self) -> Self

Source

pub fn with_dce(self, on: bool) -> Self

Source

pub fn with_constant_folding(self, on: bool) -> Self

Source

pub fn with_verbose(self, on: bool) -> Self

Source

pub fn fusion_target(self, target: FusionTarget) -> Self

Source

pub fn fusion_opts(self, opts: FusionOptions) -> Self

Source

pub fn arena_alignment(self, bytes: usize) -> Self

Source

pub fn supported_ops(self, ops: &'static [OpKind]) -> Self

Source

pub fn assert_fusion_clean(self, on: bool) -> Self

Source

pub fn dim_binding(self, binding: DimBinding) -> Self

Source

pub fn kernel_dispatch(self, policy: KernelDispatchPolicy) -> Self

Source

pub fn kernel_dispatch_config(self, config: KernelDispatchConfig) -> Self

Source

pub fn force_common_kinds(self, kinds: &'static [OpKind]) -> Self

Force listed logical kernels to use common IR even when native is in supported_ops.

Source

pub fn force_native_kinds(self, kinds: &'static [OpKind]) -> Self

Keep listed logical kernels native even under ForceCommon / missing from supported_ops.

Trait Implementations§

Source§

impl Clone for CompileOptions

Source§

fn clone(&self) -> CompileOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CompileOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CompileOptions

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

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