From 8c039ccef6ed7b482f312f72bd6eb5b27a01531a Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 24 Jul 2015 10:06:23 +0200 Subject: [PATCH] Set OpenCL sealer when -G is selected --- libethereum/Client.cpp | 8 ++++++++ libethereum/Client.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index d1d3fa22c..575ad5785 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -461,6 +461,14 @@ void Client::setShouldPrecomputeDAG(bool _precompute) sealEngine()->setOption("precomputeDAG", _precompute ? trueBytes: falseBytes); } +void Client::setTurboMining(bool _enable) +{ + m_turboMining = _enable; + sealEngine()->setSealer("opencl"); + if (isMining()) + startMining(); +} + bool Client::isMining() const { return Ethash::isWorking(m_sealEngine.get()); diff --git a/libethereum/Client.h b/libethereum/Client.h index 823726146..45a9196d1 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -135,7 +135,7 @@ public: /// Are we allowed to GPU mine? bool turboMining() const { return m_turboMining; } /// Enable/disable GPU mining. - void setTurboMining(bool _enable = true) { m_turboMining = _enable; if (isMining()) startMining(); } + void setTurboMining(bool _enable = true); /// Enable/disable precomputing of the DAG for next epoch void setShouldPrecomputeDAG(bool _precompute);