pub struct CppExtensionConfig {Show 14 fields
pub name: String,
pub sources: Vec<PathBuf>,
pub include_dirs: Vec<PathBuf>,
pub library_dirs: Vec<PathBuf>,
pub libraries: Vec<String>,
pub extra_compile_args: Vec<String>,
pub extra_link_args: Vec<String>,
pub with_cuda: bool,
pub cuda_archs: Vec<String>,
pub debug: bool,
pub build_dir: PathBuf,
pub jit_config: JitCompilationConfig,
pub custom_ops: Vec<CustomOpDefinition>,
pub cross_platform: CrossPlatformConfig,
}Expand description
Configuration for building a C++ extension
Fields§
§name: StringName of the extension module
sources: Vec<PathBuf>Source files to compile
include_dirs: Vec<PathBuf>Include directories
library_dirs: Vec<PathBuf>Library directories
libraries: Vec<String>Libraries to link
extra_compile_args: Vec<String>Extra compiler flags
extra_link_args: Vec<String>Extra linker flags
with_cuda: boolWhether to build with CUDA support
cuda_archs: Vec<String>CUDA architectures to target
debug: boolWhether to enable debug symbols
build_dir: PathBufOutput directory
jit_config: JitCompilationConfigJIT compilation settings
custom_ops: Vec<CustomOpDefinition>Custom operation definitions
cross_platform: CrossPlatformConfigCross-platform build settings
Implementations§
Source§impl CppExtensionConfig
impl CppExtensionConfig
Sourcepub fn new(name: impl Into<String>, sources: Vec<PathBuf>) -> Self
pub fn new(name: impl Into<String>, sources: Vec<PathBuf>) -> Self
Create a new C++ extension configuration
Sourcepub fn include_dir(self, dir: impl AsRef<Path>) -> Self
pub fn include_dir(self, dir: impl AsRef<Path>) -> Self
Add include directory
Sourcepub fn library_dir(self, dir: impl AsRef<Path>) -> Self
pub fn library_dir(self, dir: impl AsRef<Path>) -> Self
Add library directory
Sourcepub fn extra_compile_arg(self, arg: impl Into<String>) -> Self
pub fn extra_compile_arg(self, arg: impl Into<String>) -> Self
Add extra compile arguments
Sourcepub fn extra_link_arg(self, arg: impl Into<String>) -> Self
pub fn extra_link_arg(self, arg: impl Into<String>) -> Self
Add extra link arguments
Sourcepub fn jit(self, config: JitCompilationConfig) -> Self
pub fn jit(self, config: JitCompilationConfig) -> Self
Enable JIT compilation
Sourcepub fn custom_op(self, op: CustomOpDefinition) -> Self
pub fn custom_op(self, op: CustomOpDefinition) -> Self
Add custom operation
Sourcepub fn cross_platform(self, config: CrossPlatformConfig) -> Self
pub fn cross_platform(self, config: CrossPlatformConfig) -> Self
Set cross-platform build configuration
Sourcepub fn enable_jit(self) -> Self
pub fn enable_jit(self) -> Self
Enable JIT compilation with default settings
Sourcepub fn enable_cuda_jit(self) -> Self
pub fn enable_cuda_jit(self) -> Self
Enable CUDA JIT compilation
Trait Implementations§
Source§impl Clone for CppExtensionConfig
impl Clone for CppExtensionConfig
Source§fn clone(&self) -> CppExtensionConfig
fn clone(&self) -> CppExtensionConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CppExtensionConfig
impl RefUnwindSafe for CppExtensionConfig
impl Send for CppExtensionConfig
impl Sync for CppExtensionConfig
impl Unpin for CppExtensionConfig
impl UnsafeUnpin for CppExtensionConfig
impl UnwindSafe for CppExtensionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ProfiledStruct for T
impl<T> ProfiledStruct for T
Source§fn profiled_method<F, R>(&self, method_name: &str, func: F) -> Rwhere
F: FnOnce(&Self) -> R,
fn profiled_method<F, R>(&self, method_name: &str, func: F) -> Rwhere
F: FnOnce(&Self) -> R,
Execute a method with profiling
Source§fn profiled_method_mut<F, R>(&mut self, method_name: &str, func: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
fn profiled_method_mut<F, R>(&mut self, method_name: &str, func: F) -> Rwhere
F: FnOnce(&mut Self) -> R,
Execute a mutable method with profiling