pub struct TimelineEvent {
pub event_id: String,
pub device_id: DeviceId,
pub operation_type: String,
pub start_time: Instant,
pub end_time: Option<Instant>,
pub gpu_timestamp_start: Option<u64>,
pub gpu_timestamp_end: Option<u64>,
pub memory_usage_mb: f32,
pub workgroup_config: (u32, u32, u32),
pub buffer_sizes: Vec<u64>,
pub metadata: HashMap<String, String>,
}Expand description
GPU timeline event representing a specific operation
Fields§
§event_id: String§device_id: DeviceId§operation_type: String§start_time: Instant§end_time: Option<Instant>§gpu_timestamp_start: Option<u64>§gpu_timestamp_end: Option<u64>§memory_usage_mb: f32§workgroup_config: (u32, u32, u32)§buffer_sizes: Vec<u64>§metadata: HashMap<String, String>Implementations§
Source§impl TimelineEvent
impl TimelineEvent
Sourcepub fn new(
event_id: String,
device_id: DeviceId,
operation_type: String,
memory_usage_mb: f32,
workgroup_config: (u32, u32, u32),
buffer_sizes: Vec<u64>,
) -> Self
pub fn new( event_id: String, device_id: DeviceId, operation_type: String, memory_usage_mb: f32, workgroup_config: (u32, u32, u32), buffer_sizes: Vec<u64>, ) -> Self
Create a new timeline event
Sourcepub fn cpu_duration(&self) -> Option<Duration>
pub fn cpu_duration(&self) -> Option<Duration>
Get the CPU duration of the event
Sourcepub fn gpu_duration_ns(&self) -> Option<u64>
pub fn gpu_duration_ns(&self) -> Option<u64>
Get the GPU duration of the event (if available)
Sourcepub fn memory_bandwidth_gb_s(&self) -> f32
pub fn memory_bandwidth_gb_s(&self) -> f32
Calculate memory bandwidth utilization
Sourcepub fn add_metadata(&mut self, key: String, value: String)
pub fn add_metadata(&mut self, key: String, value: String)
Add metadata to the event
Trait Implementations§
Source§impl Clone for TimelineEvent
impl Clone for TimelineEvent
Source§fn clone(&self) -> TimelineEvent
fn clone(&self) -> TimelineEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TimelineEvent
impl RefUnwindSafe for TimelineEvent
impl Send for TimelineEvent
impl Sync for TimelineEvent
impl Unpin for TimelineEvent
impl UnwindSafe for TimelineEvent
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.