pub struct SystemEventSet(/* private fields */);Implementations§
Source§impl SystemEventSet
impl SystemEventSet
Sourcepub fn register_events(&self, event_types: SystemEventTypes) -> Result<()>
pub fn register_events(&self, event_types: SystemEventTypes) -> Result<()>
Starts recording the requested events for the system event set.
For Linux only.
Starts recording events on the specified device.
All events that occurred before this call are not recorded.
Use SystemEventSet::wait to check whether an event occurred.
If NVML reports Status::Unknown, the event set is in an undefined
state and must be freed.
If NVML reports Status::NotSupported, the event set can still be
used, but none of the requested event types are registered.
§Errors
Returns an error if the installed NVML version does not support the request layout, if NVML rejects the event registration request, if NVML has not been initialized, or if NVML reports an unexpected failure.
Sourcepub fn wait(
&self,
timeout_ms: u32,
max_events: u32,
) -> Result<Vec<SystemEventData>>
pub fn wait( &self, timeout_ms: u32, max_events: u32, ) -> Result<Vec<SystemEventData>>
Waits for system events and returns ready events.
For Fermi or newer fully supported devices.
If events are ready when this is called, it returns immediately.
If no events are ready, it sleeps until an event arrives or timeout_ms expires.
In some conditions, such as an interrupt, this can return before the timeout expires.
If the returned event count equals the internal event-buffer capacity, there may be outstanding events.
Call SystemEventSet::wait again to query all events.
§Errors
Returns an error if the installed NVML version does not support the
request layout, if NVML rejects the wait request, if no event arrives
before timeout_ms, if NVML has not been initialized, or if NVML reports
an unexpected failure.