public static Device.API.DeviceQuery GetMonitoringApiByDevice(Device.Base device) { switch (device) { case Device.CUDA cudaDevice: return(Device.API.NVML.QueryGpuStatus(cudaDevice.FullPciBusID)); case Device.AMD amdDevice: return(Device.API.AMD_ADL.QueryGpuStatus(amdDevice.PciBusID)); default: return(null); } }
public decimal GetDeviceGraphPerSec(Device.Base device) { if (!jobHistoryList.Any()) { return(0); } return(jobHistoryList. Where(j => j.DeviceID == device.DeviceID && j.EndSolveOn > DateTime.MinValue). Select(j => { var interval = j.EndSolveOn - j.BeginSolveOn; return (interval.TotalSeconds > 0) ? j.GraphAttempts / (decimal)(interval.TotalSeconds) : 0m; }). DefaultIfEmpty(0.0m). Average()); }