|
@ -14,7 +14,7 @@ |
|
|
You should have received a copy of the GNU General Public License |
|
|
You should have received a copy of the GNU General Public License |
|
|
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
|
along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
|
*/ |
|
|
*/ |
|
|
/** @file EthashGPUMiner.cpp
|
|
|
/** @file EthashCUDAMiner.cpp
|
|
|
* @author Gav Wood <i@gavwood.com> |
|
|
* @author Gav Wood <i@gavwood.com> |
|
|
* @date 2014 |
|
|
* @date 2014 |
|
|
* |
|
|
* |
|
@ -107,7 +107,7 @@ unsigned EthashCUDAMiner::s_numInstances = 0; |
|
|
EthashCUDAMiner::EthashCUDAMiner(ConstructionInfo const& _ci) : |
|
|
EthashCUDAMiner::EthashCUDAMiner(ConstructionInfo const& _ci) : |
|
|
GenericMiner<EthashProofOfWork>(_ci), |
|
|
GenericMiner<EthashProofOfWork>(_ci), |
|
|
Worker("cudaminer" + toString(index())), |
|
|
Worker("cudaminer" + toString(index())), |
|
|
m_hook(new EthashCUDAMiner(this)) |
|
|
m_hook( new EthashCUHook(this)) |
|
|
{ |
|
|
{ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -170,11 +170,11 @@ void EthashCUDAMiner::workLoop() |
|
|
uint64_t upper64OfBoundary = (uint64_t)(u64)((u256)w.boundary >> 192); |
|
|
uint64_t upper64OfBoundary = (uint64_t)(u64)((u256)w.boundary >> 192); |
|
|
m_miner->search(w.headerHash.data(), upper64OfBoundary, *m_hook); |
|
|
m_miner->search(w.headerHash.data(), upper64OfBoundary, *m_hook); |
|
|
} |
|
|
} |
|
|
catch (cl::Error const& _e) |
|
|
catch (std::runtime_error const& _e) |
|
|
{ |
|
|
{ |
|
|
delete m_miner; |
|
|
delete m_miner; |
|
|
m_miner = nullptr; |
|
|
m_miner = nullptr; |
|
|
cwarn << "Error GPU mining: " << _e.what() << "(" << _e.err() << ")"; |
|
|
cwarn << "Error CUDA mining: " << _e.what(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -186,17 +186,17 @@ void EthashCUDAMiner::pause() |
|
|
|
|
|
|
|
|
std::string EthashCUDAMiner::platformInfo() |
|
|
std::string EthashCUDAMiner::platformInfo() |
|
|
{ |
|
|
{ |
|
|
return ethash_cl_miner::platform_info(s_platformId, s_deviceId); |
|
|
return ethash_cu_miner::platform_info(s_deviceId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
unsigned EthashCUDAMiner::getNumDevices() |
|
|
unsigned EthashCUDAMiner::getNumDevices() |
|
|
{ |
|
|
{ |
|
|
return ethash_cl_miner::getNumDevices(s_platformId); |
|
|
return ethash_cu_miner::getNumDevices(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void EthashCUDAMiner::listDevices() |
|
|
void EthashCUDAMiner::listDevices() |
|
|
{ |
|
|
{ |
|
|
return ethash_cl_miner::listDevices(); |
|
|
return ethash_cu_miner::listDevices(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
bool EthashCUDAMiner::configureGPU( |
|
|
bool EthashCUDAMiner::configureGPU( |
|
|