Skip to main content

Options

Struct Options 

Source
pub struct Options {
Show 42 fields pub allow_expensive_optimizations: bool, pub compile_as_tools_patch: bool, pub compile_only: bool, pub def_load_cache: bool, pub def_store_cache: bool, pub device_debug: bool, pub device_function_maxrregcount: Option<u32>, pub disable_optimizer_constants: bool, pub disable_warnings: bool, pub dont_merge_basicblocks: bool, pub entry: String, pub extensible_whole_program: bool, pub fmad: bool, pub force_load_cache: bool, pub force_store_cache: bool, pub generate_line_info: bool, pub gpu_name: Capability, pub ptx_version: Option<u32>, pub log_level: Option<LogLevel>, pub sm_count: Option<u32>, pub maxrregcount: Option<u32>, pub opt_level: Option<OptLevel>, pub position_independent_code: bool, pub preserve_relocs: bool, pub return_at_end: bool, pub sanitize: Option<Sanitizer>, pub suppress_async_bulk_multicast_advisory_warning: bool, pub suppress_stack_size_warning: bool, pub verbose: bool, pub warn_on_double_precision_use: bool, pub warn_on_local_memory_usage: bool, pub warn_on_spills: bool, pub warning_as_error: bool, pub maxntid: Option<u32>, pub minnctapersm: Option<u32>, pub override_directive_values: bool, pub make_errors_visible_at_exit: bool, pub ofast_compile: Option<u32>, pub device_stack_protector: bool, pub g_tensor_memory_access_check: bool, pub gno_tensor_memory_access_check: bool, pub split_compile: Option<u32>,
}
Expand description

nvptxcompiler compile options, translated to CLI flags by Options::to_compile_options. Each field corresponds 1:1 to an nvptxcompiler/teenyc flag of the same name (with _ replaced by -) — see Options::parse for the string-based --options CLI encoding.

Fields§

§allow_expensive_optimizations: bool

--allow-expensive-optimizations.

§compile_as_tools_patch: bool

--compile-as-tools-patch.

§compile_only: bool

--compile-only.

§def_load_cache: bool

--def-load-cache.

§def_store_cache: bool

--def-store-cache.

§device_debug: bool

--device-debug.

§device_function_maxrregcount: Option<u32>

--device-function-maxrregcount.

§disable_optimizer_constants: bool

--disable-optimizer-constants.

§disable_warnings: bool

--disable-warnings.

§dont_merge_basicblocks: bool

--dont-merge-basicblocks.

§entry: String

--entry: the kernel entry point name.

§extensible_whole_program: bool

--extensible-whole-program.

§fmad: bool

--fmad: enable fused multiply-add contraction.

§force_load_cache: bool

--force-load-cache.

§force_store_cache: bool

--force-store-cache.

§generate_line_info: bool

--generate-line-info.

§gpu_name: Capability

--gpu-name: the target GPU’s compute capability.

§ptx_version: Option<u32>

Explicit PTX ISA version to request from teenyc (e.g. 82 for 8.2), encoded as major*10 + minor. Not an nvptxcompiler flag — excluded from Options::to_compile_options; consumed separately by crate::compiler::aot::compile_graph to override teenyc’s capability-based default when the deployment target’s exact CUDA version is known (e.g. ptx-version=82 for a Jetson Orin Nano on CUDA 12.2, since sm_87’s own default floor is conservative).

§log_level: Option<LogLevel>

teenyc’s diagnostic verbosity (see LogLevel). Not an nvptxcompiler flag — excluded from Options::to_compile_options; consumed by crate::compiler::aot::compile_graph to set LlvmCompiler::with_log_level, which in turn sets RUSTC_LOG on the teenyc subprocess. Leaving this unset (the default) preserves teenyc’s own default verbosity and skips capturing any pipeline-stage IR.

§sm_count: Option<u32>

Target device’s SM (streaming multiprocessor) count, for shape-adaptive kernel tile-size selection. Not an nvptxcompiler flag — excluded from Options::to_compile_options; consumed by teeny-kernelsTritonLowering to pick smaller tile sizes (larger grids) for conv layers whose default tile size would otherwise launch too few thread blocks to occupy the target device (e.g. deep layers with small spatial dims after repeated downsampling). Not auto-queried from a live device: AOT compilation may target a device that isn’t the one doing the compiling (e.g. cross-compiling for a Jetson from an x86 host), so this must be supplied explicitly when known (e.g. sm-count=20 for a Jetson Orin Nano). Leaving this unset (the default) preserves today’s fixed tile-size behavior unchanged.

§maxrregcount: Option<u32>

--maxrregcount (alias maxnreg in Options::parse’s string encoding).

§opt_level: Option<OptLevel>

--opt-level.

§position_independent_code: bool

--position-independent-code.

§preserve_relocs: bool

--preserve-relocs.

§return_at_end: bool

--return-at-end.

§sanitize: Option<Sanitizer>

--sanitize.

§suppress_async_bulk_multicast_advisory_warning: bool

--suppress-async-bulk-multicast-advisory-warning.

§suppress_stack_size_warning: bool

--suppress-stack-size-warning.

§verbose: bool

--verbose.

§warn_on_double_precision_use: bool

--warn-on-double-precision-use.

§warn_on_local_memory_usage: bool

--warn-on-local-memory-usage.

§warn_on_spills: bool

--warn-on-spills.

§warning_as_error: bool

--warning-as-error.

§maxntid: Option<u32>

--maxntid.

§minnctapersm: Option<u32>

--minnctapersm.

§override_directive_values: bool

--override-directive-values.

§make_errors_visible_at_exit: bool

--make-errors-visible-at-exit.

§ofast_compile: Option<u32>

--oFast-compile.

§device_stack_protector: bool

--device-stack-protector.

§g_tensor_memory_access_check: bool

--g-tensor-memory-access-check.

§gno_tensor_memory_access_check: bool

--gno-tensor-memory-access-check.

§split_compile: Option<u32>

--split-compile.

Implementations§

Source§

impl Options

Source

pub fn to_compile_options(&self) -> Vec<String>

Renders these options as nvptxcompiler/teenyc CLI flags.

Source§

impl Options

Source

pub fn parse(input: &str) -> Result<Options>

Parse a comma-separated key=value string (as passed via --options on the AOT compile CLI, e.g. "capability=sm_90,maxnreg=16") into Options.

capability (alias gpu-name) is required. Boolean flags may be given bare (key, meaning true) or as key=true/key=false. Unknown keys are rejected outright rather than silently ignored, so typos and not-yet-supported knobs (e.g. a shared-memory limit) surface immediately.

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

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more