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. 15
      libethcore/EthashCUDAMiner.cpp
  4. 24
      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;

15
libethcore/EthashCUDAMiner.cpp

@ -33,9 +33,8 @@ using namespace eth;
namespace dev
{
namespace eth
{
namespace eth
{
class EthashCUHook : public ethash_cu_miner::search_hook
{
public:
@ -96,8 +95,7 @@ namespace dev
Notified<bool> m_aborted = { true };
EthashCUDAMiner* m_owner = nullptr;
};
}
}
}
unsigned EthashCUDAMiner::s_platformId = 0;
@ -105,10 +103,9 @@ 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())),
GenericMiner<EthashProofOfWork>(_ci),
Worker("cudaminer" + toString(index())),
m_hook( new EthashCUHook(this))
{
}
@ -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,

24
libethcore/EthashCUDAMiner.h

@ -30,9 +30,8 @@ along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
namespace dev
{
namespace eth
{
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,8 +86,7 @@ namespace dev
static unsigned s_numInstances;
static int s_devices[16];
};
}
}
}
#endif

Loading…
Cancel
Save