pub struct NvrtcOpts {
pub ftz: Option<bool>,
pub maxrregcount: Option<usize>,
pub name: Option<String>,
pub use_fast_math: Option<bool>,
pub lto: bool,
pub cpp_std: Option<CppStd>,
pub arch: Option<SmArch>,
pub name_expressions: Vec<String>,
pub extra_options: Vec<String>,
pub include_paths: Vec<String>,
}Expand description
Subset of cudarc’s [CompileOptions] exposed at our message
surface, plus Phase-5 additions for LTO, C++ standard selection,
per-arch SM targeting, name-expression registration, and free-form
extra flags.
Fields§
§ftz: Option<bool>§maxrregcount: Option<usize>§name: Option<String>§use_fast_math: Option<bool>§lto: boolPhase 5: enable link-time optimisation (-dlto). CUDA 12.0+.
Off by default — LTO requires --gpu-architecture=compute_NN
(not sm_NN) and a final relocatable-device-code link step,
so combining with -rdc=true or wired into a cuLink* flow.
cpp_std: Option<CppStd>Phase 5: select C++ standard. Passed as --std=c++17 / etc.
arch: Option<SmArch>Phase 5: target SM architecture. When set, overrides any
extra_options --gpu-architecture=… flag.
name_expressions: Vec<String>Phase 5: name expressions for templated kernels.
Each string is a C++ expression (e.g.
"my_kernel<float, 256>"); after compile, KernelHandle::lowered_name
resolves it to the mangled lowered ABI symbol.
extra_options: Vec<String>Phase 5: arbitrary extra flags (-D…, -I…, --device-as-default-execution-space).
include_paths: Vec<String>Phase 5: include search paths (-I…).
Implementations§
Source§impl NvrtcOpts
impl NvrtcOpts
Sourcepub fn with_cpp_std(self, std: CppStd) -> Self
pub fn with_cpp_std(self, std: CppStd) -> Self
Builder: select C++ standard.
Sourcepub fn with_name_expression(self, expr: impl Into<String>) -> Self
pub fn with_name_expression(self, expr: impl Into<String>) -> Self
Builder: register a name expression for nvrtcAddNameExpression.
Sourcepub fn with_extra_option(self, opt: impl Into<String>) -> Self
pub fn with_extra_option(self, opt: impl Into<String>) -> Self
Builder: append a free-form extra option (-D…, etc).
Sourcepub fn with_include_path(self, path: impl Into<String>) -> Self
pub fn with_include_path(self, path: impl Into<String>) -> Self
Builder: append an include search path.
Sourcepub fn build_flags(&self) -> Vec<String>
pub fn build_flags(&self) -> Vec<String>
Materialise the full vector of NVRTC flags this NvrtcOpts
would emit. Used for cache-key hashing and trace-level logging.