Browse Source

simplify clminer current block code

cl-refactor
Lefteris Karapetsas 9 years ago
parent
commit
af6f5c3a13
  1. 4
      ethminer/MinerAux.h
  2. 3
      libethash-cl/ethash_cl_miner.cpp
  3. 1
      libethash-cl/ethash_cl_miner.h
  4. 2
      libethcore/Ethash.cpp
  5. 3
      libethcore/Ethash.h

4
ethminer/MinerAux.h

@ -211,10 +211,7 @@ public:
else if (arg == "-G" || arg == "--opencl")
m_minerType = MinerType::GPU;
else if (arg == "--current-block" && i + 1 < argc)
{
m_currentBlock = stol(argv[++i]);
m_currentBlockGiven = true;
}
else if (arg == "--no-precompute")
{
m_precompute = false;
@ -309,7 +306,6 @@ public:
m_openclDevice,
m_clAllowCPU,
m_extraGPUMemory,
m_currentBlockGiven,
m_currentBlock
))
exit(1);

3
libethash-cl/ethash_cl_miner.cpp

@ -149,7 +149,6 @@ bool ethash_cl_miner::configureGPU(
unsigned _msPerBatch,
bool _allowCPU,
unsigned _extraGPUMemory,
bool _currentBlockGiven,
uint64_t _currentBlock
)
{
@ -159,7 +158,7 @@ bool ethash_cl_miner::configureGPU(
s_allowCPU = _allowCPU;
s_extraRequiredGPUMem = _extraGPUMemory;
// by default let's only consider the DAG of the first epoch
uint64_t dagSize = _currentBlockGiven ? ethash_get_datasize(_currentBlock) : 1073739904U;
uint64_t dagSize = ethash_get_datasize(_currentBlock);
uint64_t requiredSize = dagSize + _extraGPUMemory;
return searchForAllDevices(_platformId, [&requiredSize](cl::Device const _device) -> bool
{

1
libethash-cl/ethash_cl_miner.h

@ -49,7 +49,6 @@ public:
unsigned _msPerBatch,
bool _allowCPU,
unsigned _extraGPUMemory,
bool _currentBlockGiven,
uint64_t _currentBlock
);

2
libethcore/Ethash.cpp

@ -416,7 +416,6 @@ bool Ethash::GPUMiner::configureGPU(
unsigned _deviceId,
bool _allowCPU,
unsigned _extraGPUMemory,
bool _currentBlockGiven,
uint64_t _currentBlock
)
{
@ -436,7 +435,6 @@ bool Ethash::GPUMiner::configureGPU(
_msPerBatch,
_allowCPU,
_extraGPUMemory,
_currentBlockGiven,
_currentBlock)
)
{

3
libethcore/Ethash.h

@ -88,7 +88,7 @@ public:
static unsigned instances() { return s_numInstances > 0 ? s_numInstances : std::thread::hardware_concurrency(); }
static std::string platformInfo();
static void listDevices() {}
static bool configureGPU(unsigned, unsigned, unsigned, unsigned, unsigned, bool, unsigned, bool, 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()); }
protected:
void kickOff() override
@ -125,7 +125,6 @@ public:
unsigned _deviceId,
bool _allowCPU,
unsigned _extraGPUMemory,
bool _currentBlockGiven,
uint64_t _currentBlock
);
static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, getNumDevices()); }

Loading…
Cancel
Save