Browse Source

api: use the new throughput2intensity func

master
Tanguy Pruvot 8 years ago
parent
commit
5a0b779434
  1. 11
      api.cpp
  2. 3
      miner.h

11
api.cpp

@ -1006,16 +1006,7 @@ void api_set_throughput(int thr_id, uint32_t throughput)
{ {
if (thr_id < MAX_GPUS && thr_info) { if (thr_id < MAX_GPUS && thr_info) {
struct cgpu_info *cgpu = &thr_info[thr_id].gpu; struct cgpu_info *cgpu = &thr_info[thr_id].gpu;
uint32_t ws = throughput; cgpu->intensity = throughput2intensity(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));
}
} }
// to display in bench results // to display in bench results
if (opt_benchmark) if (opt_benchmark)

3
miner.h

@ -362,8 +362,7 @@ struct cgpu_info {
int rejected; int rejected;
int hw_errors; int hw_errors;
double khashes; double khashes;
uint8_t intensity_int; int has_monitoring;
uint8_t has_monitoring;
float gpu_temp; float gpu_temp;
uint16_t gpu_fan; uint16_t gpu_fan;
uint16_t gpu_fan_rpm; uint16_t gpu_fan_rpm;

Loading…
Cancel
Save