Skip to content

Commit

Permalink
remove FieldValueRequest from FieldValueSample
Browse files Browse the repository at this point in the history
  • Loading branch information
bsteinb committed Feb 17, 2024
1 parent 759eb1b commit 1a5dced
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nvml-wrapper/src/struct_wrappers/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::enum_wrappers::device::{BridgeChip, EncoderType, FbcSessionType, Samp
use crate::enums::device::{FirmwareVersion, SampleValue, UsedGpuMemory};
use crate::error::{nvml_try, Bits, NvmlError};
use crate::ffi::bindings::*;
use crate::structs::device::{FieldId, FieldValueRequest, ScopeId};
use crate::structs::device::{FieldId, ScopeId};
#[cfg(feature = "serde")]
use serde_derive::{Deserialize, Serialize};
use std::{
Expand Down Expand Up @@ -527,7 +527,9 @@ impl From<nvmlProcessUtilizationSample_t> for ProcessUtilizationSample {
#[derive(Debug)]
pub struct FieldValueSample {
/// The field that this sample is for.
pub field: FieldValueRequest,
pub field: FieldId,
/// The field scope that this sample is for.
pub scope: ScopeId,
/// This sample's CPU timestamp in μs (Unix time).
pub timestamp: i64,
/**
Expand Down Expand Up @@ -555,7 +557,8 @@ impl TryFrom<nvmlFieldValue_t> for FieldValueSample {
*/
fn try_from(value: nvmlFieldValue_t) -> Result<Self, Self::Error> {
Ok(Self {
field: FieldValueRequest::id_with_scope(FieldId(value.fieldId), ScopeId(value.scopeId)),
field: FieldId(value.fieldId),
scope: ScopeId(value.scopeId),
timestamp: value.timestamp,
latency: value.latencyUsec,
value: match nvml_try(value.nvmlReturn) {
Expand Down

0 comments on commit 1a5dced

Please sign in to comment.