Added draft support for multi backend benchmark

This commit is contained in:
MoneroOcean 2019-11-02 20:43:02 -07:00
parent 8c0db9485c
commit 149bfbf674

View file

@ -25,6 +25,7 @@
#include "net/JobResults.h" #include "net/JobResults.h"
#include "net/Network.h" #include "net/Network.h"
#include "rapidjson/document.h" #include "rapidjson/document.h"
#include "backend/common/interfaces/IBackend.h"
#include <chrono> #include <chrono>
namespace xmrig { namespace xmrig {
@ -138,7 +139,7 @@ void Benchmark::start(const BenchAlgo bench_algo) {
// calculate number of active miner backends in m_enabled_backend_count // calculate number of active miner backends in m_enabled_backend_count
m_enabled_backend_count = 0; m_enabled_backend_count = 0;
const Algorithm algo(ba2a[bench_algo]); const Algorithm algo(ba2a[bench_algo]);
for (IBackend *backend : m_controller->miner()->backends()) if (backend->isEnabled(algo)) ++ m_enabled_backend_count; for (auto backend : m_controller->miner()->backends()) if (backend->isEnabled(algo)) ++ m_enabled_backend_count;
if (m_enabled_backend_count == 0) { if (m_enabled_backend_count == 0) {
run_next_bench_algo(m_bench_algo); run_next_bench_algo(m_bench_algo);
return; return;