Exemple #1
0
        private void SaveCLock()
        {
            Profile.ClocksList[SelectedOverclockIndex].Name = OverclockName;
            if (PowerLimits != null)
            {
                Profile.ClocksList[SelectedOverclockIndex].PowLim = PowerLimits.ToArray();
            }
            else
            {
                Profile.ClocksList[SelectedOverclockIndex].PowLim = null;
            }
            if (CoreClocks != null)
            {
                Profile.ClocksList[SelectedOverclockIndex].CoreClock = CoreClocks.ToArray();
            }
            else
            {
                Profile.ClocksList[SelectedOverclockIndex].CoreClock = null;
            }
            if (MemoryClocks != null)
            {
                Profile.ClocksList[SelectedOverclockIndex].MemoryClock = MemoryClocks.ToArray();
            }
            else
            {
                Profile.ClocksList[SelectedOverclockIndex].MemoryClock = null;
            }
            if (FanSpeeds != null)
            {
                Profile.ClocksList[SelectedOverclockIndex].FanSpeed = FanSpeeds.ToArray();
            }
            else
            {
                Profile.ClocksList[SelectedOverclockIndex].FanSpeed = null;
            }
            int n = SelectedOverclockIndex;

            OverclocksNames        = from i in Profile.ClocksList select i.Name;
            SelectedOverclockIndex = n;
        }
Exemple #2
0
        public override void Update()
        {
            if (CoreClocks.Any(x => x == null))
            {
                CoreClocks = CoreClocks.Where(x => x != null).ToArray();
            }
            if (CoreLoads.Any(x => x == null))
            {
                CoreLoads = CoreLoads.Where(x => x != null).ToArray();
            }
            if (CorePowers.Any(x => x == null))
            {
                CorePowers = CorePowers.Where(x => x != null).ToArray();
            }
            if (CoreTemperatures.Any(x => x == null))
            {
                CoreTemperatures = CoreTemperatures.Where(x => x != null).ToArray();
            }
            if (CoreVoltages.Any(x => x == null))
            {
                CoreVoltages = CoreVoltages.Where(x => x != null).ToArray();
            }


            if (HasTimeStampCounter && isInvariantTimeStampCounter)
            {
                // make sure always the same thread is used
                var mask = ThreadAffinity.Set(1UL << CpuId[0][0].Thread);

                // read time before and after getting the TSC to estimate the error
                var firstTime      = Stopwatch.GetTimestamp();
                var timeStampCount = Opcode.Rdtsc();
                var time           = Stopwatch.GetTimestamp();

                // restore the thread affinity mask
                ThreadAffinity.Set(mask);

                var delta = (double)(time - lastTime) / Stopwatch.Frequency;
                var error = (double)(time - firstTime) / Stopwatch.Frequency;

                // only use data if they are measured accuarte enough (max 0.1ms delay)
                if (error < 0.0001)
                {
                    // ignore the first reading because there are no initial values
                    // ignore readings with too large or too small time window
                    if (lastTime != 0 && delta > 0.5 && delta < 2)
                    {
                        TimeStampCounterFrequency =
                            (timeStampCount - lastTimeStampCount) / (1e6 * delta);
                    }

                    lastTimeStampCount = timeStampCount;
                    lastTime           = time;
                }
            }

            if (CpuLoad.IsAvailable)
            {
                CpuLoad.Update();
                for (var i = 0; i < CoreLoads.Length; i++)
                {
                    CoreLoads[i].Value = CpuLoad.GetCoreLoad(i);
                }
                if (TotalLoad != null)
                {
                    TotalLoad.Value = CpuLoad.GetTotalLoad();
                }
            }
        }