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: boolEnables extensible whole-program compilation.
device_debug: boolGenerates device debug information.
generate_line_info: boolGenerates 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: boolEnables the native fast-math preset.
extra_device_vectorization: boolEnables 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: boolGenerates intermediate code for device link-time optimization.
generate_optimized_lto: boolRequests optimized link-time intermediate code.
optix_ir: boolRequests OptiX intermediate representation output.
tile_compilation: Option<TileCompilation>Enable support for Tile constructs and control which code is generated.
default_tile: boolConsider unannotated functions and static-storage variables implicitly __tile__.
diagnose_implicit_tile_variable: boolDiagnose 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: boolDisables 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: boolPrevents 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: boolEnables 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: boolSuppresses native compiler warnings.
warning_as_error: Vec<WarningAsErrorKind>Warning categories promoted to compilation errors.
restrict_pointers: boolTreats kernel pointer parameters as restricted pointers.
device_as_default_execution_space: boolTreats unannotated functions as device functions.
device_int128: boolEnables device support for 128-bit integers.
device_float128: boolEnables 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: boolChecks device syntax without generating output code.
minimal: boolOmits 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>
impl<'a> CompileOptions<'a>
Sourcepub fn gpu_architecture(self, value: GpuArchitecture) -> Self
pub fn gpu_architecture(self, value: GpuArchitecture) -> Self
Sets the GPU architecture target for PTX or machine-code generation.
Sourcepub fn relocatable_device_code(self, value: bool) -> Self
pub fn relocatable_device_code(self, value: bool) -> Self
Enables or disables relocatable device code for subsequent linking.
Sourcepub fn extensible_whole_program(self, value: bool) -> Self
pub fn extensible_whole_program(self, value: bool) -> Self
Enables or disables extensible whole-program compilation.
Sourcepub fn device_debug(self, value: bool) -> Self
pub fn device_debug(self, value: bool) -> Self
Enables or disables device debug information.
Sourcepub fn generate_line_info(self, value: bool) -> Self
pub fn generate_line_info(self, value: bool) -> Self
Enables or disables device source line information.
Sourcepub fn device_optimization(self, value: bool) -> Self
pub fn device_optimization(self, value: bool) -> Self
Requests --dopt=on when value is true.
False leaves the native optimization default in effect.
Sourcepub fn fast_compile(self, value: FastCompileLevel) -> Self
pub fn fast_compile(self, value: FastCompileLevel) -> Self
Sets the compilation-speed tradeoff between optimization effort and generated-code performance.
Sourcepub fn ptxas_option(self, value: &'a str) -> Self
pub fn ptxas_option(self, value: &'a str) -> Self
Appends a PTX assembler option string as a separate --ptxas-options argument.
Sourcepub fn max_register_count(self, value: i32) -> Self
pub fn max_register_count(self, value: i32) -> Self
Sets the requested maximum register count per GPU thread, subject to native ABI minimums.
Sourcepub fn flush_to_zero(self, value: bool) -> Self
pub fn flush_to_zero(self, value: bool) -> Self
Controls whether single-precision denormal values are flushed to zero.
Sourcepub fn precise_square_root(self, value: bool) -> Self
pub fn precise_square_root(self, value: bool) -> Self
Selects precise or approximate single-precision square roots.
Sourcepub fn precise_division(self, value: bool) -> Self
pub fn precise_division(self, value: bool) -> Self
Selects precise or approximate single-precision division.
Sourcepub fn fmad(self, value: bool) -> Self
pub fn fmad(self, value: bool) -> Self
Controls contraction of floating-point multiply and add operations.
Sourcepub fn use_fast_math(self, value: bool) -> Self
pub fn use_fast_math(self, value: bool) -> Self
Enables or disables the native fast-math preset.
Sourcepub fn extra_device_vectorization(self, value: bool) -> Self
pub fn extra_device_vectorization(self, value: bool) -> Self
Enables or disables additional device-code vectorization.
Sourcepub fn modify_stack_limit(self, value: bool) -> Self
pub fn modify_stack_limit(self, value: bool) -> Self
Controls whether NVRTC may temporarily raise the process-wide stack limit during compilation on Linux.
Sourcepub fn dlink_time_optimization(self, value: bool) -> Self
pub fn dlink_time_optimization(self, value: bool) -> Self
Enables or disables device link-time intermediate-code generation.
Sourcepub fn generate_optimized_lto(self, value: bool) -> Self
pub fn generate_optimized_lto(self, value: bool) -> Self
Enables or disables generation of optimized link-time intermediate code.
Sourcepub fn optix_ir(self, value: bool) -> Self
pub fn optix_ir(self, value: bool) -> Self
Enables or disables OptiX intermediate representation output.
Sourcepub fn jump_table_density(self, value: u8) -> Self
pub fn jump_table_density(self, value: u8) -> Self
Sets the case-density percentage threshold for generating a switch jump table.
Sourcepub fn no_cache(self, value: bool) -> Self
pub fn no_cache(self, value: bool) -> Self
Controls whether native PTX and cubin generation caches are disabled.
Sourcepub fn random_seed(self, value: &'a str) -> Self
pub fn random_seed(self, value: &'a str) -> Self
Sets the seed string used for compiler-generated symbol and variable names.
Sourcepub fn define_macro(self, value: MacroDefinition<'a>) -> Self
pub fn define_macro(self, value: MacroDefinition<'a>) -> Self
Appends a preprocessor macro definition.
Sourcepub fn undefine_macro(self, value: &'a str) -> Self
pub fn undefine_macro(self, value: &'a str) -> Self
Appends a preprocessor macro name to undefine.
Sourcepub fn include_path(self, value: &'a str) -> Self
pub fn include_path(self, value: &'a str) -> Self
Appends a header search directory.
Sourcepub fn pre_include_header(self, value: &'a str) -> Self
pub fn pre_include_header(self, value: &'a str) -> Self
Appends a header to include before processing the source.
Sourcepub fn no_source_include(self, value: bool) -> Self
pub fn no_source_include(self, value: bool) -> Self
Controls whether the source file directory is omitted from the header search path.
Sourcepub fn cpp_dialect(self, value: CppDialect) -> Self
pub fn cpp_dialect(self, value: CppDialect) -> Self
Sets the C++ language standard.
Sourcepub fn builtin_move_forward(self, value: bool) -> Self
pub fn builtin_move_forward(self, value: bool) -> Self
Controls whether NVRTC supplies built-in std::move and std::forward definitions.
Sourcepub fn builtin_initializer_list(self, value: bool) -> Self
pub fn builtin_initializer_list(self, value: bool) -> Self
Controls whether NVRTC supplies a built-in std::initializer_list definition.
Sourcepub fn pch(self, value: bool) -> Self
pub fn pch(self, value: bool) -> Self
Enables or disables automatic precompiled-header processing.
Sourcepub fn create_pch(self, value: &'a str) -> Self
pub fn create_pch(self, value: &'a str) -> Self
Sets the path of a precompiled-header file to create explicitly.
Sourcepub fn use_pch(self, value: &'a str) -> Self
pub fn use_pch(self, value: &'a str) -> Self
Sets the path of an existing precompiled-header file to use.
Sourcepub fn pch_dir(self, value: &'a str) -> Self
pub fn pch_dir(self, value: &'a str) -> Self
Sets the directory used for automatic precompiled-header files.
Sourcepub fn pch_verbose(self, value: bool) -> Self
pub fn pch_verbose(self, value: bool) -> Self
Controls whether the log explains why candidate automatic precompiled headers could not be used.
Sourcepub fn pch_messages(self, value: bool) -> Self
pub fn pch_messages(self, value: bool) -> Self
Controls whether the log reports creating or using a precompiled header.
Sourcepub fn instantiate_templates_in_pch(self, value: bool) -> Self
pub fn instantiate_templates_in_pch(self, value: bool) -> Self
Controls template instantiation while creating a precompiled header.
Sourcepub fn disable_warnings(self, value: bool) -> Self
pub fn disable_warnings(self, value: bool) -> Self
Controls suppression of native compiler warnings.
Sourcepub fn warning_as_error(self, value: WarningAsErrorKind) -> Self
pub fn warning_as_error(self, value: WarningAsErrorKind) -> Self
Appends a warning category to promote to compilation errors.
Sourcepub fn restrict_pointers(self, value: bool) -> Self
pub fn restrict_pointers(self, value: bool) -> Self
Controls whether kernel pointer parameters are treated as restricted pointers.
Sourcepub fn device_as_default_execution_space(self, value: bool) -> Self
pub fn device_as_default_execution_space(self, value: bool) -> Self
Controls whether unannotated functions are treated as device functions.
Sourcepub fn device_int128(self, value: bool) -> Self
pub fn device_int128(self, value: bool) -> Self
Enables or disables device support for 128-bit integer types.
Sourcepub fn device_float128(self, value: bool) -> Self
pub fn device_float128(self, value: bool) -> Self
Enables or disables device support for 128-bit floating-point types.
Sourcepub fn optimization_info(self, value: OptimizationInfoKind) -> Self
pub fn optimization_info(self, value: OptimizationInfoKind) -> Self
Appends a category of optimization reports to request.
Sourcepub fn display_error_number(self, value: bool) -> Self
pub fn display_error_number(self, value: bool) -> Self
Controls whether diagnostics display their numeric identifiers.
Sourcepub fn diag_error(self, value: i32) -> Self
pub fn diag_error(self, value: i32) -> Self
Appends a diagnostic number to promote to an error.
Sourcepub fn diag_suppress(self, value: i32) -> Self
pub fn diag_suppress(self, value: i32) -> Self
Appends a diagnostic number to suppress.
Sourcepub fn brief_diagnostics(self, value: bool) -> Self
pub fn brief_diagnostics(self, value: bool) -> Self
Controls whether to use brief diagnostic output.
Sourcepub fn split_compile(self, value: i32) -> Self
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.
Sourcepub fn device_syntax_only(self, value: bool) -> Self
pub fn device_syntax_only(self, value: bool) -> Self
Enables or disables syntax-only device compilation without valid output code.
Sourcepub fn minimal(self, value: bool) -> Self
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.
Sourcepub fn device_stack_protector(self, value: bool) -> Self
pub fn device_stack_protector(self, value: bool) -> Self
Enables or disables device stack protection.
Sourcepub fn device_time_trace(self, value: &'a str) -> Self
pub fn device_time_trace(self, value: &'a str) -> Self
Sets the file for the device compilation time trace.
Sourcepub fn raw_option(self, value: &'a str) -> Self
pub fn raw_option(self, value: &'a str) -> Self
Appends a native option string after the typed options.
Sourcepub fn cancel_flag(self, flag: Arc<AtomicBool>) -> Self
pub fn cancel_flag(self, flag: Arc<AtomicBool>) -> Self
Sets the flag another thread sets to true to cancel compilation.
Sourcepub fn as_arguments(&self) -> Vec<String>
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.