Browse Source

OpenCL: Drop "allow CPU" option

cl-refactor
Paweł Bylica 8 years ago
parent
commit
a64f3d5d2c
No known key found for this signature in database GPG Key ID: 7A0C037434FE77EF
  1. 7
      ethminer/MinerAux.h
  2. 7
      libethash-cl/ethash_cl_miner.cpp
  3. 3
      libethash-cl/ethash_cl_miner.h
  4. 2
      libethcore/EthashGPUMiner.cpp
  5. 1
      libethcore/EthashGPUMiner.h

7
ethminer/MinerAux.h

@ -288,10 +288,6 @@ public:
else if ((arg == "--cl-extragpu-mem" || arg == "--cuda-extragpu-mem") && i + 1 < argc)
m_extraGPUMemory = 1000000 * stol(argv[++i]);
#endif
#if ETH_ETHASHCL
else if (arg == "--allow-opencl-cpu")
m_clAllowCPU = true;
#endif
#if ETH_ETHASHCUDA
else if (arg == "--cuda-devices")
{
@ -477,7 +473,6 @@ public:
m_globalWorkSizeMultiplier,
m_openclPlatform,
m_openclDevice,
m_clAllowCPU,
m_extraGPUMemory,
0,
m_dagLoadMode,
@ -567,7 +562,6 @@ public:
<< " --opencl-device <n> When mining using -G/--opencl use OpenCL device n (default: 0)." << endl
<< " --opencl-devices <0 1 ..n> Select which OpenCL devices to mine on. Default is to use all" << endl
<< " -t, --mining-threads <n> Limit number of CPU/GPU miners to n (default: use everything available on selected platform)" << endl
<< " --allow-opencl-cpu Allows CPU to be considered as an OpenCL device if the OpenCL platform supports it." << endl
<< " --list-devices List the detected OpenCL/CUDA devices and exit. Should be combined with -G or -U flag" << endl
<< " -L, --dag-load-mode <mode> DAG generation mode." << endl
<< " parallel - load DAG on all GPUs at the same time (default)" << endl
@ -1012,7 +1006,6 @@ private:
unsigned m_openclDevice = 0;
unsigned m_miningThreads = UINT_MAX;
bool m_shouldListDevices = false;
bool m_clAllowCPU = false;
#if ETH_ETHASHCL
unsigned m_openclDeviceCount = 0;
unsigned m_openclDevices[16];

7
libethash-cl/ethash_cl_miner.cpp

@ -84,8 +84,6 @@ static std::atomic_flag s_logSpin = ATOMIC_FLAG_INIT;
#else
#define ETHCL_LOG(_contents) cout << "[OPENCL]:" << _contents << endl
#endif
// Types of OpenCL devices we are interested in
#define ETHCL_QUERIED_DEVICE_TYPES (CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR)
static void addDefinition(string& _source, char const* _id, unsigned _value)
{
@ -154,7 +152,7 @@ std::vector<cl::Device> ethash_cl_miner::getDevices(std::vector<cl::Platform> co
try
{
_platforms[platform_num].getDevices(
s_allowCPU ? CL_DEVICE_TYPE_ALL : ETHCL_QUERIED_DEVICE_TYPES,
CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR,
&devices
);
}
@ -194,14 +192,12 @@ bool ethash_cl_miner::configureGPU(
unsigned _platformId,
unsigned _localWorkSize,
unsigned _globalWorkSize,
bool _allowCPU,
unsigned _extraGPUMemory,
uint64_t _currentBlock
)
{
s_workgroupSize = _localWorkSize;
s_initialGlobalWorkSize = _globalWorkSize;
s_allowCPU = _allowCPU;
s_extraRequiredGPUMem = _extraGPUMemory;
// by default let's only consider the DAG of the first epoch
@ -230,7 +226,6 @@ bool ethash_cl_miner::configureGPU(
);
}
bool ethash_cl_miner::s_allowCPU = false;
unsigned ethash_cl_miner::s_extraRequiredGPUMem;
unsigned ethash_cl_miner::s_workgroupSize = ethash_cl_miner::c_defaultLocalWorkSize;
unsigned ethash_cl_miner::s_initialGlobalWorkSize = ethash_cl_miner::c_defaultGlobalWorkSizeMultiplier * ethash_cl_miner::c_defaultLocalWorkSize;

3
libethash-cl/ethash_cl_miner.h

@ -54,7 +54,6 @@ public:
unsigned _platformId,
unsigned _localWorkSize,
unsigned _globalWorkSize,
bool _allowCPU,
unsigned _extraGPUMemory,
uint64_t _currentBlock
);
@ -97,8 +96,6 @@ private:
static unsigned s_initialGlobalWorkSize;
/// The target milliseconds per batch for the search. If 0, then no adjustment will happen
static unsigned s_msPerBatch;
/// Allow CPU to appear as an OpenCL device or not. Default is false
static bool s_allowCPU;
/// GPU memory required for other things, like window rendering e.t.c.
/// User can set it via the --cl-extragpu-mem argument.
static unsigned s_extraRequiredGPUMem;

2
libethcore/EthashGPUMiner.cpp

@ -206,7 +206,6 @@ bool EthashGPUMiner::configureGPU(
unsigned _globalWorkSizeMultiplier,
unsigned _platformId,
unsigned _deviceId,
bool _allowCPU,
unsigned _extraGPUMemory,
uint64_t _currentBlock,
unsigned _dagLoadMode,
@ -225,7 +224,6 @@ bool EthashGPUMiner::configureGPU(
_platformId,
_localWorkSize,
_globalWorkSizeMultiplier * _localWorkSize,
_allowCPU,
_extraGPUMemory,
_currentBlock
)

1
libethcore/EthashGPUMiner.h

@ -53,7 +53,6 @@ public:
unsigned _globalWorkSizeMultiplier,
unsigned _platformId,
unsigned _deviceId,
bool _allowCPU,
unsigned _extraGPUMemory,
uint64_t _currentBlock,
unsigned _dagLoadMode,

Loading…
Cancel
Save