Skip to content

Commit

Permalink
Fix tuning on non Alder Lake CPUs.
Browse files Browse the repository at this point in the history
  • Loading branch information
michal-zurkowski committed Nov 7, 2021
1 parent afdf6db commit f175f0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
9 changes: 5 additions & 4 deletions algo/gr/gr-gate.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,15 +856,16 @@ void tune(void *input, int thr_id) {
}
uint8_t variant[3] = {cn_map[cn[i][0]], cn_map[cn[i][1]], cn_map[cn[i][2]]};

size_t disabled_threads = opt_ecores;
size_t disabled_threads = (opt_ecores == -1) ? 0 : opt_ecores;
static volatile bool stop_thread_tune = false;
static size_t final_disabled_threads = 0;
stop_thread_tune = false;
final_disabled_threads = opt_ecores - (opt_ecores / 4);
final_disabled_threads = 0;

// Try to add E cores back. It is possible it is beneficial on faster
// rotations like 3, 4, 10, 16.
if (opt_ecores != -1 && opt_ecores > 0) {
if (opt_ecores > 0) {
final_disabled_threads = opt_ecores - (opt_ecores / 4);
do {
sync_conf();
bench_hashrate = 0;
Expand Down Expand Up @@ -916,7 +917,7 @@ void tune(void *input, int thr_id) {
// By default all E cores should be disabled.
// This should allow for all E cores to not be used and start reducing
// number of P threads in "standard" manner of 1t per core.
if (opt_ecores != -1) {
if (opt_ecores > 0) {
// That way all ecores will be disabled and we will start benchmarking
// with all P coreas and reduce amount of threads one by one.
disabled_threads = opt_ecores + 1;
Expand Down
3 changes: 0 additions & 3 deletions cpu-miner.c
Original file line number Diff line number Diff line change
Expand Up @@ -4380,9 +4380,6 @@ int main(int argc, char *argv[]) {
applog(LOG_WARNING, "Miner did not detect 12th Gen Intel. Make sure it "
"is if you want to use ecores option.");
}
} else {
// Make sure ecores number is at least 0.
opt_ecores = 0;
}

#ifdef AFFINITY_USES_UINT128
Expand Down

0 comments on commit f175f0e

Please sign in to comment.