pub struct Library {
pub libtorch_dir: &'static Path,
pub api: Api,
pub use_cxx11_abi: bool,
}
Expand description
The information of libtorch installation and its capabilities.
Fields§
§libtorch_dir: &'static Path
The installation directory.
api: Api
The CUDA API variants.
use_cxx11_abi: bool
True if host system uses C++11 ABI.
Implementations§
Source§impl Library
impl Library
Sourcepub fn include_paths(
&self,
use_cuda_api: impl Into<Option<bool>>,
) -> Result<impl Iterator<Item = PathBuf>>
pub fn include_paths( &self, use_cuda_api: impl Into<Option<bool>>, ) -> Result<impl Iterator<Item = PathBuf>>
Generate include paths that is passed to C++ compiler.
The use_cuda_api
determines whether to enable CUDA API.
true
: CUDA is mandatory.false
: CUDA is disabled.None
: CUDA is enabled if supported.
Sourcepub fn link_paths(
&self,
use_cuda_api: impl Into<Option<bool>>,
) -> Result<impl Iterator<Item = PathBuf>>
pub fn link_paths( &self, use_cuda_api: impl Into<Option<bool>>, ) -> Result<impl Iterator<Item = PathBuf>>
Generate link paths that is passed to C++ compiler.
The use_cuda_api
determines whether to enable CUDA API.
true
: CUDA is mandatory.false
: CUDA is disabled.None
: CUDA is enabled if supported.
Sourcepub fn libraries(
&self,
use_cuda_api: impl Into<Option<bool>>,
use_python: bool,
) -> Result<impl Iterator<Item = &'static str>>
pub fn libraries( &self, use_cuda_api: impl Into<Option<bool>>, use_python: bool, ) -> Result<impl Iterator<Item = &'static str>>
Generate linked libraries that is passed to C++ compiler.
The use_cuda_api
determines whether to enable CUDA API.
true
: CUDA is mandatory.false
: CUDA is disabled.None
: CUDA is enabled if supported.
Sourcepub fn is_cuda_api_available(&self) -> bool
pub fn is_cuda_api_available(&self) -> bool
Check if CUDA runtime is available.
Trait Implementations§
impl Eq for Library
impl StructuralPartialEq for Library
Auto Trait Implementations§
impl Freeze for Library
impl RefUnwindSafe for Library
impl Send for Library
impl Sync for Library
impl Unpin for Library
impl UnwindSafe for Library
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.