use crate::error::NvmlError;
use crate::ffi::bindings::*;
#[cfg(feature = "serde")]
use serde_derive::{Deserialize, Serialize};
use wrapcenum_derive::EnumWrapper;
#[derive(EnumWrapper, Debug, Clone, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[wrap(c_enum = "nvmlNvLinkUtilizationCountUnits_enum")]
pub enum UtilizationCountUnit {
#[wrap(c_variant = "NVML_NVLINK_COUNTER_UNIT_CYCLES")]
Cycles,
#[wrap(c_variant = "NVML_NVLINK_COUNTER_UNIT_PACKETS")]
Packets,
#[wrap(c_variant = "NVML_NVLINK_COUNTER_UNIT_BYTES")]
Bytes,
}
#[derive(EnumWrapper, Debug, Clone, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[wrap(c_enum = "nvmlNvLinkCapability_enum")]
pub enum Capability {
#[wrap(c_variant = "NVML_NVLINK_CAP_P2P_SUPPORTED")]
P2p,
#[wrap(c_variant = "NVML_NVLINK_CAP_SYSMEM_ACCESS")]
SysMemAccess,
#[wrap(c_variant = "NVML_NVLINK_CAP_P2P_ATOMICS")]
P2pAtomics,
#[wrap(c_variant = "NVML_NVLINK_CAP_SYSMEM_ATOMICS")]
SysMemAtomics,
#[wrap(c_variant = "NVML_NVLINK_CAP_SLI_BRIDGE")]
SliBridge,
#[wrap(c_variant = "NVML_NVLINK_CAP_VALID")]
ValidLink,
}
#[derive(EnumWrapper, Debug, Clone, Eq, PartialEq, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[wrap(c_enum = "nvmlNvLinkErrorCounter_enum")]
pub enum ErrorCounter {
#[wrap(c_variant = "NVML_NVLINK_ERROR_DL_REPLAY")]
DlReplay,
#[wrap(c_variant = "NVML_NVLINK_ERROR_DL_RECOVERY")]
DlRecovery,
#[wrap(c_variant = "NVML_NVLINK_ERROR_DL_CRC_FLIT")]
DlCrcFlit,
#[wrap(c_variant = "NVML_NVLINK_ERROR_DL_CRC_DATA")]
DlCrcData,
}