Browse Source

Fix listing CUDA devices crash

cl-refactor
Paweł Bylica 8 years ago
parent
commit
4819c3e91f
No known key found for this signature in database GPG Key ID: 7A0C037434FE77EF
  1. 9
      libethash-cuda/ethash_cuda_miner.cpp

9
libethash-cuda/ethash_cuda_miner.cpp

@ -180,6 +180,8 @@ unsigned ethash_cuda_miner::s_numStreams = ethash_cuda_miner::c_defaultNumStream
unsigned ethash_cuda_miner::s_scheduleFlag = 0;
void ethash_cuda_miner::listDevices()
{
try
{
string outString = "\nListing CUDA devices.\nFORMAT: [deviceID] deviceName\n";
for (unsigned int i = 0; i < getNumDevices(); i++)
@ -193,6 +195,11 @@ void ethash_cuda_miner::listDevices()
}
ETHCUDA_LOG(outString);
}
catch(std::runtime_error const& err)
{
std::cerr << err.what();
}
}
void ethash_cuda_miner::finish()
{
@ -281,7 +288,7 @@ bool ethash_cuda_miner::init(ethash_light_t _light, uint8_t const* _lightData, u
return true;
}
catch (runtime_error)
catch (runtime_error const&)
{
return false;
}

Loading…
Cancel
Save