Browse Source

renamed Minertype:GPU to Minertype:CL

style fixes
cl-refactor
Jan Willem Penterman 9 years ago
parent
commit
a71438cbbf
  1. 26
      ethminer/MinerAux.h
  2. 2
      libethash-cu/ethash_cu_miner.cpp

26
ethminer/MinerAux.h

@ -233,7 +233,8 @@ public:
BOOST_THROW_EXCEPTION(BadArgument()); BOOST_THROW_EXCEPTION(BadArgument());
} }
else if (arg == "--benchmark-trials" && i + 1 < argc) else if (arg == "--benchmark-trials" && i + 1 < argc)
try { try
{
m_benchmarkTrials = stol(argv[++i]); m_benchmarkTrials = stol(argv[++i]);
} }
catch (...) catch (...)
@ -244,14 +245,15 @@ public:
else if (arg == "-C" || arg == "--cpu") else if (arg == "-C" || arg == "--cpu")
m_minerType = MinerType::CPU; m_minerType = MinerType::CPU;
else if (arg == "-G" || arg == "--opencl") else if (arg == "-G" || arg == "--opencl")
m_minerType = MinerType::GPU; m_minerType = MinerType::CL;
else if (arg == "-U" || arg == "--cuda") { else if (arg == "-U" || arg == "--cuda")
{
m_minerType = MinerType::CUDA; m_minerType = MinerType::CUDA;
cout << "Genoil's CUDA ethminer" << endl; cout << "Genoil's CUDA ethminer" << endl;
cout << "=====================================================================" << endl; cout << "=====================================================================" << endl;
cout << "Forked from github.com/ethereum/cpp-ethereum" << endl; cout << "Forked from github.com/ethereum/cpp-ethereum" << endl;
cout << "Ported from tim hughes' OpenCL kernel" << endl; cout << "Ported from Tim Hughes' OpenCL kernel" << endl;
cout << "With contributions from tpruvot and sp_ " << endl << endl; cout << "With contributions from tpruvot and sp_ " << endl << endl;
cout << "Please consider donating a tiny fraction of the extra performance to:" << endl; cout << "Please consider donating a tiny fraction of the extra performance to:" << endl;
cout << "ETH: 0xb9310b185455f863f526dab3d245809f6854b4d" << endl; cout << "ETH: 0xb9310b185455f863f526dab3d245809f6854b4d" << endl;
@ -337,7 +339,7 @@ public:
if (m_shouldListDevices) if (m_shouldListDevices)
{ {
#if ETH_ETHASHCL || !ETH_TRUE #if ETH_ETHASHCL || !ETH_TRUE
if (m_minerType == MinerType::GPU) if (m_minerType == MinerType::CL)
EthashGPUMiner::listDevices(); EthashGPUMiner::listDevices();
#endif #endif
#if ETH_ETHASHCU || !ETH_TRUE #if ETH_ETHASHCU || !ETH_TRUE
@ -349,7 +351,7 @@ public:
if (m_minerType == MinerType::CPU) if (m_minerType == MinerType::CPU)
EthashCPUMiner::setNumInstances(m_miningThreads); EthashCPUMiner::setNumInstances(m_miningThreads);
else if (m_minerType == MinerType::GPU) else if (m_minerType == MinerType::CL)
{ {
#if ETH_ETHASHCL || !ETH_TRUE #if ETH_ETHASHCL || !ETH_TRUE
if (!EthashGPUMiner::configureGPU( if (!EthashGPUMiner::configureGPU(
@ -382,8 +384,8 @@ public:
m_currentBlock m_currentBlock
)) ))
exit(1); exit(1);
if (m_cudaDeviceCount != 0)
if (m_cudaDeviceCount != 0) { {
EthashCUDAMiner::setDevices(m_cudaDevices, m_cudaDeviceCount); EthashCUDAMiner::setDevices(m_cudaDevices, m_cudaDeviceCount);
m_miningThreads = m_cudaDeviceCount; m_miningThreads = m_cudaDeviceCount;
} }
@ -454,7 +456,7 @@ public:
enum class MinerType enum class MinerType
{ {
CPU, CPU,
GPU, CL,
CUDA CUDA
}; };
@ -488,7 +490,7 @@ private:
f.setSealers(sealers); f.setSealers(sealers);
f.onSolutionFound([&](EthashProofOfWork::Solution) { return false; }); f.onSolutionFound([&](EthashProofOfWork::Solution) { return false; });
string platformInfo = _m == MinerType::CPU ? "CPU" : (_m == MinerType::GPU ? "GPU" : "CUDA"); string platformInfo = _m == MinerType::CPU ? "CPU" : (_m == MinerType::CL ? "GPU" : "CUDA");
cout << "Benchmarking on platform: " << platformInfo << endl; cout << "Benchmarking on platform: " << platformInfo << endl;
cout << "Preparing DAG..." << endl; cout << "Preparing DAG..." << endl;
@ -498,7 +500,7 @@ private:
f.setWork(genesis); f.setWork(genesis);
if (_m == MinerType::CPU) if (_m == MinerType::CPU)
f.start("cpu"); f.start("cpu");
else if (_m == MinerType::GPU) else if (_m == MinerType::CL)
f.start("opencl"); f.start("opencl");
else if (_m == MinerType::CUDA) else if (_m == MinerType::CUDA)
f.start("cuda"); f.start("cuda");
@ -575,7 +577,7 @@ private:
f.setSealers(sealers); f.setSealers(sealers);
if (_m == MinerType::CPU) if (_m == MinerType::CPU)
f.start("cpu"); f.start("cpu");
else if (_m == MinerType::GPU) else if (_m == MinerType::CL)
f.start("opencl"); f.start("opencl");
else if (_m == MinerType::CUDA) else if (_m == MinerType::CUDA)
f.start("cuda"); f.start("cuda");

2
libethash-cu/ethash_cu_miner.cpp

@ -118,7 +118,6 @@ std::string ethash_cu_miner::platform_info(unsigned _deviceId)
sprintf(compute, "%d.%d", device_props.major, device_props.minor); sprintf(compute, "%d.%d", device_props.major, device_props.minor);
return "{ \"platform\": \"CUDA " + std::string(platform) + "\", \"device\": \"" + device_props.name + "\", \"version\": \"Compute " + std::string(compute) + "\" }"; return "{ \"platform\": \"CUDA " + std::string(platform) + "\", \"device\": \"" + device_props.name + "\", \"version\": \"Compute " + std::string(compute) + "\" }";
} }
unsigned ethash_cu_miner::getNumDevices() unsigned ethash_cu_miner::getNumDevices()
@ -201,7 +200,6 @@ void ethash_cu_miner::finish()
bool ethash_cu_miner::init(uint8_t const* _dag, uint64_t _dagSize, unsigned _deviceId) bool ethash_cu_miner::init(uint8_t const* _dag, uint64_t _dagSize, unsigned _deviceId)
{ {
int device_count = getNumDevices(); int device_count = getNumDevices();
if (device_count == 0) if (device_count == 0)

Loading…
Cancel
Save