Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Commit 6a6d6c7

Browse files
committedMay 4, 2018
Check debug level instead of using channel logic
1 parent 623ae19 commit 6a6d6c7

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed
 

‎ethminer/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ void help()
3939
MinerCLI::streamHelp(cout);
4040
cout
4141
<< " General Options:" << endl
42-
<< " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (default: 5). Set to 9 for switch time logging." << endl
42+
<< " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (default: 5). Set to 6 or greater for switch time logging." << endl
4343
<< " -V,--version Show the version and exit." << endl
4444
<< " -h,--help Show this help message and exit." << endl
4545
<< " Environment variables:" << endl

‎libethash-cuda/CUDAMiner.cpp

+6-13
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,7 @@ struct CUDAChannel: public LogChannel
3434
static const bool debug = false;
3535
};
3636

37-
struct CUDASwitchChannel: public LogChannel
38-
{
39-
static const char* name() { return EthOrange " cu"; }
40-
static const int verbosity = 6;
41-
static const bool debug = false;
42-
};
43-
4437
#define cudalog clog(CUDAChannel)
45-
#define cudaswitchlog clog(CUDASwitchChannel)
4638

4739
CUDAMiner::CUDAMiner(FarmFace& _farm, unsigned _index) :
4840
Miner("cuda-", _farm, _index),
@@ -431,8 +423,6 @@ void CUDAMiner::search(
431423
uint64_t _startN,
432424
const dev::eth::WorkPackage& w)
433425
{
434-
CUDA_SAFE_CALL(cudaDeviceSynchronize());
435-
436426
uint64_t current_nonce;
437427

438428
set_header(*reinterpret_cast<hash32_t const *>(header));
@@ -514,9 +504,12 @@ void CUDAMiner::search(
514504
addHashCount(batch_size);
515505
bool t = true;
516506
if (m_new_work.compare_exchange_strong(t, false)) {
517-
cudaswitchlog << "Switch time "
518-
<< std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - workSwitchStart).count()
519-
<< "ms.";
507+
if (g_logVerbosity >= 6) {
508+
cudalog << "Switch time "
509+
<< std::chrono::duration_cast<std::chrono::milliseconds>
510+
(std::chrono::high_resolution_clock::now() - workSwitchStart).count()
511+
<< "ms.";
512+
}
520513
break;
521514
}
522515
if (shouldStop())

0 commit comments

Comments
 (0)
This repository has been archived.