nvml_wrapper/bitmasks/
mod.rs

1pub mod device;
2pub mod event;
3pub mod nv_link;
4
5use crate::ffi::bindings::*;
6use bitflags::bitflags;
7#[cfg(feature = "serde")]
8use serde_derive::{Deserialize, Serialize};
9
10bitflags! {
11    /// Generic flags used to specify the default behavior of some functions.
12    // Checked against local
13    #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
14    pub struct Behavior: u32 {
15        const DEFAULT = nvmlFlagDefault;
16        const FORCE   = nvmlFlagForce;
17    }
18}
19
20bitflags! {
21    /// Flags that can be passed to `Nvml::init_with_flags()`.
22    #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
23    #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, Default)]
24    pub struct InitFlags: u32 {
25        /// Don't fail to initialize when no NVIDIA GPUs are found.
26        const NO_GPUS = NVML_INIT_FLAG_NO_GPUS;
27        /// Don't attach GPUs during initialization.
28        const NO_ATTACH = NVML_INIT_FLAG_NO_ATTACH;
29    }
30}