Browse Source

fixed ethashcl build

cl-refactor
arkpar 10 years ago
parent
commit
855ba20a0f
  1. 2
      libethcore/BlockInfo.h
  2. 12
      libethcore/Ethash.cpp
  3. 2
      libethereum/Client.h
  4. 2
      libp2p/Host.cpp

2
libethcore/BlockInfo.h

@ -75,7 +75,7 @@ DEV_SIMPLE_EXCEPTION(NoHashRecorded);
* The default constructor creates an empty object, which can be tested against with the boolean * The default constructor creates an empty object, which can be tested against with the boolean
* conversion operator. * conversion operator.
*/ */
struct BlockInfo class BlockInfo
{ {
friend class BlockChain; friend class BlockChain;
public: public:

12
libethcore/Ethash.cpp

@ -196,7 +196,7 @@ public:
static unsigned instances() { return s_numInstances > 0 ? s_numInstances : std::thread::hardware_concurrency(); } static unsigned instances() { return s_numInstances > 0 ? s_numInstances : std::thread::hardware_concurrency(); }
static std::string platformInfo(); static std::string platformInfo();
static void listDevices() {} static void listDevices() {}
static bool configureGPU(unsigned, unsigned, unsigned, unsigned, unsigned, bool, unsigned, boost::optional<uint64_t>) { return false; } static bool configureGPU(unsigned, unsigned, unsigned, unsigned, unsigned, bool, unsigned, uint64_t) { return false; }
static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, std::thread::hardware_concurrency()); } static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, std::thread::hardware_concurrency()); }
protected: protected:
@ -234,7 +234,7 @@ public:
unsigned _deviceId, unsigned _deviceId,
bool _allowCPU, bool _allowCPU,
unsigned _extraGPUMemory, unsigned _extraGPUMemory,
boost::optional<uint64_t> _currentBlock uint64_t _currentBlock
); );
static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, getNumDevices()); } static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, getNumDevices()); }
@ -246,7 +246,7 @@ private:
void workLoop() override; void workLoop() override;
bool report(uint64_t _nonce); bool report(uint64_t _nonce);
using Miner::accumulateHashes; using GenericMiner<EthashProofOfWork>::accumulateHashes;
EthashCLHook* m_hook = nullptr; EthashCLHook* m_hook = nullptr;
ethash_cl_miner* m_miner = nullptr; ethash_cl_miner* m_miner = nullptr;
@ -448,7 +448,7 @@ std::string EthashCPUMiner::platformInfo()
class EthashCLHook: public ethash_cl_miner::search_hook class EthashCLHook: public ethash_cl_miner::search_hook
{ {
public: public:
EthashCLHook(Ethash::GPUMiner* _owner): m_owner(_owner) {} EthashCLHook(EthashGPUMiner* _owner): m_owner(_owner) {}
EthashCLHook(EthashCLHook const&) = delete; EthashCLHook(EthashCLHook const&) = delete;
void abort() void abort()
@ -511,7 +511,7 @@ unsigned EthashGPUMiner::s_deviceId = 0;
unsigned EthashGPUMiner::s_numInstances = 0; unsigned EthashGPUMiner::s_numInstances = 0;
EthashGPUMiner::EthashGPUMiner(ConstructionInfo const& _ci): EthashGPUMiner::EthashGPUMiner(ConstructionInfo const& _ci):
Miner(_ci), GenericMiner<EthashProofOfWork>(_ci),
Worker("gpuminer" + toString(index())), Worker("gpuminer" + toString(index())),
m_hook(new EthashCLHook(this)) m_hook(new EthashCLHook(this))
{ {
@ -527,7 +527,7 @@ EthashGPUMiner::~EthashGPUMiner()
bool EthashGPUMiner::report(uint64_t _nonce) bool EthashGPUMiner::report(uint64_t _nonce)
{ {
Nonce n = (Nonce)(u64)_nonce; Nonce n = (Nonce)(u64)_nonce;
Result r = EthashAux::eval(work().seedHash, work().headerHash, n); EthashProofOfWork::Result r = EthashAux::eval(work().seedHash, work().headerHash, n);
if (r.value < work().boundary) if (r.value < work().boundary)
return submitProof(Solution{n, r.mixHash}); return submitProof(Solution{n, r.mixHash});
return false; return false;

2
libethereum/Client.h

@ -337,7 +337,7 @@ public:
{ {
m_sealEngine = std::shared_ptr<SealEngineFace>(Ethash::createSealEngine()); m_sealEngine = std::shared_ptr<SealEngineFace>(Ethash::createSealEngine());
m_sealEngine->onSealGenerated([=](bytes const& header){ m_sealEngine->onSealGenerated([=](bytes const& header){
return this->submitSealed(header); this->submitSealed(header);
}); });
init(_host, _dbPath, _forceAction, _networkId); init(_host, _dbPath, _forceAction, _networkId);
} }

2
libp2p/Host.cpp

@ -627,7 +627,7 @@ void Host::run(boost::system::error_code const&)
m_nodeTable->processEvents(); m_nodeTable->processEvents();
// cleanup zombies // cleanup zombies
DEV_GUARDED(x_connecting); DEV_GUARDED(x_connecting)
m_connecting.remove_if([](std::weak_ptr<RLPXHandshake> h){ return h.expired(); }); m_connecting.remove_if([](std::weak_ptr<RLPXHandshake> h){ return h.expired(); });
DEV_GUARDED(x_timers) DEV_GUARDED(x_timers)
m_timers.remove_if([](std::shared_ptr<boost::asio::deadline_timer> t) m_timers.remove_if([](std::shared_ptr<boost::asio::deadline_timer> t)

Loading…
Cancel
Save