From 5a0b77943401ae4f90ddca19d83284baf1f23895 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Tue, 27 Sep 2016 23:20:28 +0200 Subject: [PATCH] api: use the new throughput2intensity func --- api.cpp | 11 +---------- miner.h | 3 +-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/api.cpp b/api.cpp index b103df5..917ef10 100644 --- a/api.cpp +++ b/api.cpp @@ -1006,16 +1006,7 @@ void api_set_throughput(int thr_id, uint32_t throughput) { if (thr_id < MAX_GPUS && thr_info) { struct cgpu_info *cgpu = &thr_info[thr_id].gpu; - uint32_t ws = throughput; - uint8_t i = 0; - cgpu->throughput = throughput; - while (ws > 1 && i++ < 32) - ws = ws >> 1; - cgpu->intensity_int = i; - cgpu->intensity = (float) i; - if (i && (1U << i) < throughput) { - cgpu->intensity += ((float) (throughput-(1U << i)) / (1U << i)); - } + cgpu->intensity = throughput2intensity(throughput); } // to display in bench results if (opt_benchmark) diff --git a/miner.h b/miner.h index 7028d84..88064e1 100644 --- a/miner.h +++ b/miner.h @@ -362,8 +362,7 @@ struct cgpu_info { int rejected; int hw_errors; double khashes; - uint8_t intensity_int; - uint8_t has_monitoring; + int has_monitoring; float gpu_temp; uint16_t gpu_fan; uint16_t gpu_fan_rpm;