Browse Source

Merge pull request #111 from ethereum-mining/cpu

Remove CPU miner leftovers
master
Paweł Bylica 8 years ago
committed by GitHub
parent
commit
cf7e9c6bcd
  1. 32
      ethminer/MinerAux.h
  2. 5
      libethcore/Miner.h
  3. 4
      libstratum/EthStratumClient.cpp
  4. 4
      libstratum/EthStratumClientV2.cpp

32
ethminer/MinerAux.h

@ -81,7 +81,6 @@ public:
enum class OperationMode
{
None,
DAGInit,
Benchmark,
Simulation,
Farm,
@ -380,8 +379,6 @@ public:
cerr << "Bad " << arg << " option: " << argv[i] << endl;
BOOST_THROW_EXCEPTION(BadArgument());
}
else if (arg == "-C" || arg == "--cpu")
m_minerType = MinerType::CPU;
else if (arg == "-G" || arg == "--opencl")
m_minerType = MinerType::CL;
else if (arg == "-U" || arg == "--cuda")
@ -464,17 +461,10 @@ public:
if (m_minerType == MinerType::CUDA || m_minerType == MinerType::Mixed)
EthashCUDAMiner::listDevices();
#endif
if (m_minerType == MinerType::CPU)
cout << "--list-devices should be combined with GPU mining flag (-G for OpenCL or -U for CUDA)" << endl;
exit(0);
}
if (m_minerType == MinerType::CPU)
{
cout << "CPU mining is no longer supported in this miner. Use -G (opencl) or -U (cuda) flag to select GPU platform." << endl;
exit(0);
}
else if (m_minerType == MinerType::CL || m_minerType == MinerType::Mixed)
if (m_minerType == MinerType::CL || m_minerType == MinerType::Mixed)
{
#if ETH_ETHASHCL
if (m_openclDeviceCount > 0)
@ -605,8 +595,6 @@ public:
;
}
MinerType minerType() const { return m_minerType; }
private:
void doBenchmark(MinerType _m, unsigned _warmupDuration = 15, unsigned _trialDuration = 3, unsigned _trials = 5)
@ -627,7 +615,7 @@ private:
f.setSealers(sealers);
f.onSolutionFound([&](Solution) { return false; });
string platformInfo = _m == MinerType::CPU ? "CPU" : (_m == MinerType::CL ? "CL" : "CUDA");
string platformInfo = _m == MinerType::CL ? "CL" : "CUDA";
cout << "Benchmarking on platform: " << platformInfo << endl;
cout << "Preparing DAG for block #" << m_benchmarkBlock << endl;
@ -635,9 +623,7 @@ private:
genesis.setDifficulty(u256(1) << 63);
f.setWork(genesis);
if (_m == MinerType::CPU)
f.start("cpu", false);
else if (_m == MinerType::CL)
if (_m == MinerType::CL)
f.start("opencl", false);
else if (_m == MinerType::CUDA)
f.start("cuda", false);
@ -692,7 +678,7 @@ private:
#endif
f.setSealers(sealers);
string platformInfo = _m == MinerType::CPU ? "CPU" : (_m == MinerType::CL ? "CL" : "CUDA");
string platformInfo = _m == MinerType::CL ? "CL" : "CUDA";
cout << "Running mining simulation on platform: " << platformInfo << endl;
cout << "Preparing DAG for block #" << m_benchmarkBlock << endl;
@ -701,9 +687,7 @@ private:
genesis.setDifficulty(u256(1) << difficulty);
f.setWork(genesis);
if (_m == MinerType::CPU)
f.start("cpu", false);
else if (_m == MinerType::CL)
if (_m == MinerType::CL)
f.start("opencl", false);
else if (_m == MinerType::CUDA)
f.start("cuda", false);
@ -782,9 +766,7 @@ private:
h256 id = h256::random();
Farm f;
f.setSealers(sealers);
if (_m == MinerType::CPU)
f.start("cpu", false);
else if (_m == MinerType::CL)
if (_m == MinerType::CL)
f.start("opencl", false);
else if (_m == MinerType::CUDA)
f.start("cuda", false);
@ -1019,7 +1001,7 @@ private:
/// Mining options
bool m_running = true;
MinerType m_minerType = MinerType::CPU;
MinerType m_minerType = MinerType::Mixed;
unsigned m_openclPlatform = 0;
unsigned m_openclDevice = 0;
unsigned m_miningThreads = UINT_MAX;

5
libethcore/Miner.h

@ -61,10 +61,9 @@ namespace eth
enum class MinerType
{
CPU,
Mixed,
CL,
CUDA,
Mixed
CUDA
};
/// Describes the progress of a mining operation.

4
libstratum/EthStratumClient.cpp

@ -176,9 +176,7 @@ void EthStratumClient::connect_handler(const boost::system::error_code& ec, tcp:
if (!p_farm->isMining())
{
cnote << "Starting farm";
if (m_minerType == MinerType::CPU)
p_farm->start("cpu", false);
else if (m_minerType == MinerType::CL)
if (m_minerType == MinerType::CL)
p_farm->start("opencl", false);
else if (m_minerType == MinerType::CUDA)
p_farm->start("cuda", false);

4
libstratum/EthStratumClientV2.cpp

@ -141,9 +141,7 @@ void EthStratumClientV2::connect()
if (!p_farm->isMining())
{
cnote << "Starting farm";
if (m_minerType == MinerType::CPU)
p_farm->start("cpu", false);
else if (m_minerType == MinerType::CL)
if (m_minerType == MinerType::CL)
p_farm->start("opencl", false);
else if (m_minerType == MinerType::CUDA)
p_farm->start("cuda", false);

Loading…
Cancel
Save