pub enum Cuda {}
Expand description
Cuda related helper functions.
Implementations§
source§impl Cuda
impl Cuda
sourcepub fn device_count() -> i64
pub fn device_count() -> i64
Returns the number of CUDA devices available.
sourcepub fn is_available() -> bool
pub fn is_available() -> bool
Returns true if at least one CUDA device is available.
sourcepub fn cudnn_is_available() -> bool
pub fn cudnn_is_available() -> bool
Returns true if CUDA is available, and CuDNN is available.
sourcepub fn manual_seed(seed: u64)
pub fn manual_seed(seed: u64)
sourcepub fn manual_seed_all(seed: u64)
pub fn manual_seed_all(seed: u64)
sourcepub fn synchronize(device_index: i64)
pub fn synchronize(device_index: i64)
Waits for all kernels in all streams on a CUDA device to complete.
§Arguments
device_index
- A signed 64bit int to indice which device to wait for.
sourcepub fn user_enabled_cudnn() -> bool
pub fn user_enabled_cudnn() -> bool
Returns true if cudnn is enabled by the user.
This does not indicate whether cudnn is actually usable.
sourcepub fn set_user_enabled_cudnn(b: bool)
pub fn set_user_enabled_cudnn(b: bool)
Enable or disable cudnn.
sourcepub fn cudnn_set_benchmark(b: bool)
pub fn cudnn_set_benchmark(b: bool)
Sets cudnn benchmark mode.
When set cudnn will try to optimize the generators durning the first network runs and then use the optimized architecture in the following runs. This can result in significant performance improvements.
Auto Trait Implementations§
impl Freeze for Cuda
impl RefUnwindSafe for Cuda
impl Send for Cuda
impl Sync for Cuda
impl Unpin for Cuda
impl UnwindSafe for Cuda
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