Skip to main content

CompileOptions

Struct CompileOptions 

Source
pub struct CompileOptions<'a> {
Show 60 fields pub gpu_architecture: Option<GpuArchitecture>, pub relocatable_device_code: Option<bool>, pub extensible_whole_program: bool, pub device_debug: bool, pub generate_line_info: bool, pub device_optimization: Option<bool>, pub fast_compile: Option<FastCompileLevel>, pub ptxas_options: Vec<&'a str>, pub max_register_count: Option<i32>, pub flush_to_zero: Option<bool>, pub precise_square_root: Option<bool>, pub precise_division: Option<bool>, pub fmad: Option<bool>, pub use_fast_math: bool, pub extra_device_vectorization: bool, pub modify_stack_limit: Option<bool>, pub dlink_time_optimization: bool, pub generate_optimized_lto: bool, pub optix_ir: bool, pub tile_compilation: Option<TileCompilation>, pub default_tile: bool, pub diagnose_implicit_tile_variable: bool, pub jump_table_density: Option<u8>, pub no_cache: bool, pub random_seed: Option<&'a str>, pub define_macros: Vec<MacroDefinition<'a>>, pub undefine_macros: Vec<&'a str>, pub include_paths: Vec<&'a str>, pub pre_include_headers: Vec<&'a str>, pub no_source_include: bool, pub cpp_dialect: Option<CppDialect>, pub builtin_move_forward: Option<bool>, pub builtin_initializer_list: Option<bool>, pub pch: bool, pub create_pch: Option<&'a str>, pub use_pch: Option<&'a str>, pub pch_dir: Option<&'a str>, pub pch_verbose: Option<bool>, pub pch_messages: Option<bool>, pub instantiate_templates_in_pch: Option<bool>, pub disable_warnings: bool, pub warning_as_error: Vec<WarningAsErrorKind>, pub restrict_pointers: bool, pub device_as_default_execution_space: bool, pub device_int128: bool, pub device_float128: bool, pub optimization_info: Vec<OptimizationInfoKind>, pub display_error_number: Option<bool>, pub diag_error: Vec<i32>, pub diag_suppress: Vec<i32>, pub diag_warn: Vec<i32>, pub brief_diagnostics: Option<bool>, pub time: Option<&'a str>, pub split_compile: Option<i32>, pub device_syntax_only: bool, pub minimal: bool, pub device_stack_protector: Option<bool>, pub device_time_trace: Option<&'a str>, pub raw_options: Vec<&'a str>, pub cancel_flag: Option<Arc<AtomicBool>>,
}
Expand description

Typed NVRTC compilation options. Unset optional values and disabled flag switches leave the corresponding native option unspecified. String lists preserve insertion order; raw_options are appended last. Validation occurs when the program is materialized or compiled.

Fields§

§gpu_architecture: Option<GpuArchitecture>

GPU architecture target used for PTX or machine-code generation.

§relocatable_device_code: Option<bool>

Whether to generate relocatable device code for subsequent linking.

§extensible_whole_program: bool

Enables extensible whole-program compilation.

§device_debug: bool

Generates device debug information.

§generate_line_info: bool

Generates source line information for device code.

§device_optimization: Option<bool>

Emits --dopt=on only for Some(true). None and Some(false) leave the native default in effect.

§fast_compile: Option<FastCompileLevel>

Compilation-speed setting that trades generated-code optimization for shorter compilation.

§ptxas_options: Vec<&'a str>

Additional PTX assembler option strings, each emitted as a separate --ptxas-options argument.

§max_register_count: Option<i32>

Requested maximum register count per GPU thread, subject to native ABI minimums.

§flush_to_zero: Option<bool>

Whether single-precision denormal results are flushed to zero.

§precise_square_root: Option<bool>

Whether single-precision square roots use the precise native implementation.

§precise_division: Option<bool>

Whether single-precision division uses the precise native implementation.

§fmad: Option<bool>

Whether floating-point multiply and add operations may be contracted.

§use_fast_math: bool

Enables the native fast-math preset.

§extra_device_vectorization: bool

Enables additional device-code vectorization.

§modify_stack_limit: Option<bool>

Whether NVRTC may temporarily raise the process-wide stack limit during compilation on Linux.

§dlink_time_optimization: bool

Generates intermediate code for device link-time optimization.

§generate_optimized_lto: bool

Requests optimized link-time intermediate code.

§optix_ir: bool

Requests OptiX intermediate representation output.

§tile_compilation: Option<TileCompilation>

Enable support for Tile constructs and control which code is generated.

§default_tile: bool

Consider unannotated functions and static-storage variables implicitly __tile__.

§diagnose_implicit_tile_variable: bool

Diagnose variables that cannot be implicitly annotated with __tile__.

§jump_table_density: Option<u8>

Case-density percentage threshold for generating a switch jump table.

§no_cache: bool

Disables native caching for both PTX and cubin generation.

§random_seed: Option<&'a str>

Seed string used for compiler-generated symbol and variable names.

§define_macros: Vec<MacroDefinition<'a>>

Preprocessor macro definitions emitted in insertion order.

§undefine_macros: Vec<&'a str>

Preprocessor macro names to undefine.

§include_paths: Vec<&'a str>

Additional header search directories.

§pre_include_headers: Vec<&'a str>

Headers included before processing the source.

§no_source_include: bool

Prevents adding the source file directory to the header search path.

§cpp_dialect: Option<CppDialect>

C++ language standard used for compilation.

§builtin_move_forward: Option<bool>

Whether NVRTC supplies built-in definitions of std::move and std::forward.

§builtin_initializer_list: Option<bool>

Whether NVRTC supplies a built-in definition of std::initializer_list.

§pch: bool

Enables automatic precompiled-header processing.

§create_pch: Option<&'a str>

Path of an explicitly created precompiled-header file.

§use_pch: Option<&'a str>

Path of an existing precompiled-header file to use.

§pch_dir: Option<&'a str>

Directory used for automatic precompiled-header files.

§pch_verbose: Option<bool>

Whether to emit verbose precompiled-header diagnostics.

§pch_messages: Option<bool>

Whether to emit precompiled-header processing messages.

§instantiate_templates_in_pch: Option<bool>

Whether to instantiate templates while creating a precompiled header.

§disable_warnings: bool

Suppresses native compiler warnings.

§warning_as_error: Vec<WarningAsErrorKind>

Warning categories promoted to compilation errors.

§restrict_pointers: bool

Treats kernel pointer parameters as restricted pointers.

§device_as_default_execution_space: bool

Treats unannotated functions as device functions.

§device_int128: bool

Enables device support for 128-bit integers.

§device_float128: bool

Enables device support for 128-bit floating-point types.

§optimization_info: Vec<OptimizationInfoKind>

Categories of optimization reports to request.

§display_error_number: Option<bool>

Whether diagnostics display their numeric identifiers.

§diag_error: Vec<i32>

Diagnostic numbers promoted to errors.

§diag_suppress: Vec<i32>

Diagnostic numbers to suppress.

§diag_warn: Vec<i32>

Diagnostic numbers demoted to warnings.

§brief_diagnostics: Option<bool>

Whether to use brief diagnostic output.

§time: Option<&'a str>

File for compiler phase timing output.

§split_compile: Option<i32>

Maximum number of threads used by parallel compilation.

§device_syntax_only: bool

Checks device syntax without generating output code.

§minimal: bool

Omits texture, surface, device-runtime, device-launch, and runtime/driver type features to reduce compilation time.

§device_stack_protector: Option<bool>

Whether to enable device stack protection.

§device_time_trace: Option<&'a str>

File for the device compilation time trace.

§raw_options: Vec<&'a str>

Additional native option strings appended after the typed options.

§cancel_flag: Option<Arc<AtomicBool>>

Flag another thread sets to true to cancel compilation; it must stay true until compilation returns. It is not rendered as an argument.

Implementations§

Source§

impl<'a> CompileOptions<'a>

Source

pub const fn new() -> Self

Creates an empty option set that leaves native defaults in effect.

Source

pub fn gpu_architecture(self, value: GpuArchitecture) -> Self

Sets the GPU architecture target for PTX or machine-code generation.

Source

pub fn relocatable_device_code(self, value: bool) -> Self

Enables or disables relocatable device code for subsequent linking.

Source

pub fn extensible_whole_program(self, value: bool) -> Self

Enables or disables extensible whole-program compilation.

Source

pub fn device_debug(self, value: bool) -> Self

Enables or disables device debug information.

Source

pub fn generate_line_info(self, value: bool) -> Self

Enables or disables device source line information.

Source

pub fn device_optimization(self, value: bool) -> Self

Requests --dopt=on when value is true. False leaves the native optimization default in effect.

Source

pub fn fast_compile(self, value: FastCompileLevel) -> Self

Sets the compilation-speed tradeoff between optimization effort and generated-code performance.

Source

pub fn ptxas_option(self, value: &'a str) -> Self

Appends a PTX assembler option string as a separate --ptxas-options argument.

Source

pub fn max_register_count(self, value: i32) -> Self

Sets the requested maximum register count per GPU thread, subject to native ABI minimums.

Source

pub fn flush_to_zero(self, value: bool) -> Self

Controls whether single-precision denormal values are flushed to zero.

Source

pub fn precise_square_root(self, value: bool) -> Self

Selects precise or approximate single-precision square roots.

Source

pub fn precise_division(self, value: bool) -> Self

Selects precise or approximate single-precision division.

Source

pub fn fmad(self, value: bool) -> Self

Controls contraction of floating-point multiply and add operations.

Source

pub fn use_fast_math(self, value: bool) -> Self

Enables or disables the native fast-math preset.

Source

pub fn extra_device_vectorization(self, value: bool) -> Self

Enables or disables additional device-code vectorization.

Source

pub fn modify_stack_limit(self, value: bool) -> Self

Controls whether NVRTC may temporarily raise the process-wide stack limit during compilation on Linux.

Enables or disables device link-time intermediate-code generation.

Source

pub fn generate_optimized_lto(self, value: bool) -> Self

Enables or disables generation of optimized link-time intermediate code.

Source

pub fn optix_ir(self, value: bool) -> Self

Enables or disables OptiX intermediate representation output.

Source

pub fn jump_table_density(self, value: u8) -> Self

Sets the case-density percentage threshold for generating a switch jump table.

Source

pub fn no_cache(self, value: bool) -> Self

Controls whether native PTX and cubin generation caches are disabled.

Source

pub fn random_seed(self, value: &'a str) -> Self

Sets the seed string used for compiler-generated symbol and variable names.

Source

pub fn define_macro(self, value: MacroDefinition<'a>) -> Self

Appends a preprocessor macro definition.

Source

pub fn undefine_macro(self, value: &'a str) -> Self

Appends a preprocessor macro name to undefine.

Source

pub fn include_path(self, value: &'a str) -> Self

Appends a header search directory.

Source

pub fn pre_include_header(self, value: &'a str) -> Self

Appends a header to include before processing the source.

Source

pub fn no_source_include(self, value: bool) -> Self

Controls whether the source file directory is omitted from the header search path.

Source

pub fn cpp_dialect(self, value: CppDialect) -> Self

Sets the C++ language standard.

Source

pub fn builtin_move_forward(self, value: bool) -> Self

Controls whether NVRTC supplies built-in std::move and std::forward definitions.

Source

pub fn builtin_initializer_list(self, value: bool) -> Self

Controls whether NVRTC supplies a built-in std::initializer_list definition.

Source

pub fn pch(self, value: bool) -> Self

Enables or disables automatic precompiled-header processing.

Source

pub fn create_pch(self, value: &'a str) -> Self

Sets the path of a precompiled-header file to create explicitly.

Source

pub fn use_pch(self, value: &'a str) -> Self

Sets the path of an existing precompiled-header file to use.

Source

pub fn pch_dir(self, value: &'a str) -> Self

Sets the directory used for automatic precompiled-header files.

Source

pub fn pch_verbose(self, value: bool) -> Self

Controls whether the log explains why candidate automatic precompiled headers could not be used.

Source

pub fn pch_messages(self, value: bool) -> Self

Controls whether the log reports creating or using a precompiled header.

Source

pub fn instantiate_templates_in_pch(self, value: bool) -> Self

Controls template instantiation while creating a precompiled header.

Source

pub fn disable_warnings(self, value: bool) -> Self

Controls suppression of native compiler warnings.

Source

pub fn warning_as_error(self, value: WarningAsErrorKind) -> Self

Appends a warning category to promote to compilation errors.

Source

pub fn restrict_pointers(self, value: bool) -> Self

Controls whether kernel pointer parameters are treated as restricted pointers.

Source

pub fn device_as_default_execution_space(self, value: bool) -> Self

Controls whether unannotated functions are treated as device functions.

Source

pub fn device_int128(self, value: bool) -> Self

Enables or disables device support for 128-bit integer types.

Source

pub fn device_float128(self, value: bool) -> Self

Enables or disables device support for 128-bit floating-point types.

Source

pub fn optimization_info(self, value: OptimizationInfoKind) -> Self

Appends a category of optimization reports to request.

Source

pub fn display_error_number(self, value: bool) -> Self

Controls whether diagnostics display their numeric identifiers.

Source

pub fn diag_error(self, value: i32) -> Self

Appends a diagnostic number to promote to an error.

Source

pub fn diag_suppress(self, value: i32) -> Self

Appends a diagnostic number to suppress.

Source

pub fn diag_warn(self, value: i32) -> Self

Appends a diagnostic number to demote to a warning.

Source

pub fn brief_diagnostics(self, value: bool) -> Self

Controls whether to use brief diagnostic output.

Source

pub fn time(self, value: &'a str) -> Self

Sets the file for compiler phase timing output.

Source

pub fn split_compile(self, value: i32) -> Self

Sets the maximum number of parallel optimization threads. Zero uses the available system threads; one disables splitting.

Source

pub fn device_syntax_only(self, value: bool) -> Self

Enables or disables syntax-only device compilation without valid output code.

Source

pub fn minimal(self, value: bool) -> Self

Enables or disables minimal compilation, which omits texture, surface, device-runtime, device-launch, and runtime/driver type features.

Source

pub fn device_stack_protector(self, value: bool) -> Self

Enables or disables device stack protection.

Source

pub fn device_time_trace(self, value: &'a str) -> Self

Sets the file for the device compilation time trace.

Source

pub fn raw_option(self, value: &'a str) -> Self

Appends a native option string after the typed options.

Source

pub fn cancel_flag(self, flag: Arc<AtomicBool>) -> Self

Sets the flag another thread sets to true to cancel compilation.

Source

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

Renders configured options as owned NVRTC command-line argument strings. This performs no native compilation or option validation.

Trait Implementations§

Source§

impl<'a> Clone for CompileOptions<'a>

Source§

fn clone(&self) -> Self

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<'a> Debug for CompileOptions<'a>

Source§

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

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

impl<'a> Default for CompileOptions<'a>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'a> Forget for CompileOptions<'a>

§

impl<'a> Freeze for CompileOptions<'a>

§

impl<'a> Move for CompileOptions<'a>

§

impl<'a> RefUnwindSafe for CompileOptions<'a>

§

impl<'a> Send for CompileOptions<'a>

§

impl<'a> Sync for CompileOptions<'a>

§

impl<'a> Unpin for CompileOptions<'a>

§

impl<'a> UnsafeUnpin for CompileOptions<'a>

§

impl<'a> UnwindSafe for CompileOptions<'a>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.