Browse Source

style fixes; removed unused var

cl-refactor
Jan Willem Penterman 10 years ago
parent
commit
4adf0e5b1e
  1. 2
      ethminer/MinerAux.h
  2. 1
      libethash-cu/ethash_cu_miner.cpp
  3. 5
      libethcore/EthashCUDAMiner.cpp
  4. 18
      libethcore/EthashCUDAMiner.h

2
ethminer/MinerAux.h

@ -491,7 +491,7 @@ private:
f.setSealers(sealers);
f.onSolutionFound([&](EthashProofOfWork::Solution) { return false; });
string platformInfo = _m == MinerType::CPU ? "CPU" : (_m == MinerType::CL ? "GPU" : "CUDA");
string platformInfo = _m == MinerType::CPU ? "CPU" : (_m == MinerType::CL ? "CL" : "CUDA");
cout << "Benchmarking on platform: " << platformInfo << endl;
cout << "Preparing DAG..." << endl;

1
libethash-cu/ethash_cu_miner.cpp

@ -177,7 +177,6 @@ bool ethash_cu_miner::s_highCPU = false;
void ethash_cu_miner::listDevices()
{
string outString = "\nListing CUDA devices.\nFORMAT: [deviceID] deviceName\n";
unsigned int i = 0;
for (unsigned int i = 0; i < getNumDevices(); i++)
{
cudaDeviceProp props;

5
libethcore/EthashCUDAMiner.cpp

@ -35,7 +35,6 @@ namespace dev
{
namespace eth
{
class EthashCUHook : public ethash_cu_miner::search_hook
{
public:
@ -96,7 +95,6 @@ namespace dev
Notified<bool> m_aborted = { true };
EthashCUDAMiner* m_owner = nullptr;
};
}
}
@ -105,7 +103,6 @@ unsigned EthashCUDAMiner::s_deviceId = 0;
unsigned EthashCUDAMiner::s_numInstances = 0;
int EthashCUDAMiner::s_devices[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
EthashCUDAMiner::EthashCUDAMiner(ConstructionInfo const& _ci) :
GenericMiner<EthashProofOfWork>(_ci),
Worker("cudaminer" + toString(index())),
@ -212,13 +209,11 @@ bool EthashCUDAMiner::configureGPU(
)
{
s_deviceId = _deviceId;
if (_blockSize != 32 && _blockSize != 64 && _blockSize != 128)
{
cout << "Given localWorkSize of " << toString(_blockSize) << "is invalid. Must be either 32,64 or 128" << endl;
return false;
}
if (!ethash_cu_miner::configureGPU(
_blockSize,
_gridSize,

18
libethcore/EthashCUDAMiner.h

@ -32,7 +32,6 @@ namespace dev
{
namespace eth
{
class EthashCUDAMiner : public GenericMiner<EthashProofOfWork>, Worker
{
friend class dev::eth::EthashCUHook;
@ -41,7 +40,10 @@ namespace dev
EthashCUDAMiner(ConstructionInfo const& _ci);
~EthashCUDAMiner();
static unsigned instances() { return s_numInstances > 0 ? s_numInstances : 1; }
static unsigned instances()
{
return s_numInstances > 0 ? s_numInstances : 1;
}
static std::string platformInfo();
static unsigned getNumDevices();
static void listDevices();
@ -54,9 +56,14 @@ namespace dev
bool _highcpu,
uint64_t _currentBlock
);
static void setNumInstances(unsigned _instances) { s_numInstances = std::min<unsigned>(_instances, getNumDevices()); }
static void setDevices(unsigned * _devices, unsigned _selectedDeviceCount) {
for (unsigned i = 0; i < _selectedDeviceCount; i++) {
static void setNumInstances(unsigned _instances)
{
s_numInstances = std::min<unsigned>(_instances, getNumDevices());
}
static void setDevices(unsigned * _devices, unsigned _selectedDeviceCount)
{
for (unsigned i = 0; i < _selectedDeviceCount; i++)
{
s_devices[i] = _devices[i];
}
}
@ -79,7 +86,6 @@ namespace dev
static unsigned s_numInstances;
static int s_devices[16];
};
}
}

Loading…
Cancel
Save