Skip to main content

NvrtcOpts

Struct NvrtcOpts 

Source
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: bool

Phase 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

Source

pub fn for_arch(arch: SmArch) -> Self

Convenience constructor selecting an SM arch.

Source

pub fn with_lto(self) -> Self

Builder: enable LTO.

Source

pub fn with_cpp_std(self, std: CppStd) -> Self

Builder: select C++ standard.

Source

pub fn with_name_expression(self, expr: impl Into<String>) -> Self

Builder: register a name expression for nvrtcAddNameExpression.

Source

pub fn with_extra_option(self, opt: impl Into<String>) -> Self

Builder: append a free-form extra option (-D…, etc).

Source

pub fn with_include_path(self, path: impl Into<String>) -> Self

Builder: append an include search path.

Source

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.

Trait Implementations§

Source§

impl Clone for NvrtcOpts

Source§

fn clone(&self) -> NvrtcOpts

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NvrtcOpts

Source§

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

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

impl Default for NvrtcOpts

Source§

fn default() -> NvrtcOpts

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.

§

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

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
§

impl<T> Extension for T
where T: Any + Send + Sync,