private void OverClock(INTMinerContext ntminerContext, IGpuProfile data) { #if DEBUG NTStopwatch.Start(); #endif if (ntminerContext.GpuSet.TryGetGpu(data.Index, out IGpu gpu)) { ntminerContext.GpuSet.OverClock.OverClock(gpuIndex: data.Index, OverClockValue.Create(data)); if (data.Index == NTMinerContext.GpuAllId) { NTMinerConsole.UserOk($"统一超频:{data.ToOverClockString()}"); } else { NTMinerConsole.UserOk($"GPU{gpu.Index}超频:{data.ToOverClockString()}"); } 2.SecondsDelay().ContinueWith(t => { ntminerContext.GpuSet.OverClock.RefreshGpuState(data.Index); }); } #if DEBUG var elapsedMilliseconds = NTStopwatch.Stop(); if (elapsedMilliseconds.ElapsedMilliseconds > NTStopwatch.ElapsedMilliseconds) { NTMinerConsole.DevTimeSpan($"耗时{elapsedMilliseconds} {this.GetType().Name}.{nameof(OverClock)}"); } #endif }
public void OverClock(int gpuIndex, OverClockValue value) { if (gpuIndex == NTMinerContext.GpuAllId) { foreach (var gpu in NTMinerContext.Instance.GpuSet.AsEnumerable()) { if (gpu.Index == NTMinerContext.GpuAllId) { continue; } _gpuHelper.OverClock(gpu, value); } } else { if (!NTMinerContext.Instance.GpuSet.TryGetGpu(gpuIndex, out IGpu gpu)) { return; } _gpuHelper.OverClock(gpu, value); } }
public void OverClock(int gpuIndex, OverClockValue value) { // nothing need todo }