mirror of
https://github.com/GOSTSec/ccminer
synced 2025-02-02 01:44:32 +00:00
api: use the new throughput2intensity func
This commit is contained in:
parent
a43205a84f
commit
5a0b779434
11
api.cpp
11
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user