From a64f3d5d2c2fd89d8b3764a84a376d8de802b8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 26 Jun 2017 13:42:10 +0200 Subject: [PATCH] OpenCL: Drop "allow CPU" option --- ethminer/MinerAux.h | 7 ------- libethash-cl/ethash_cl_miner.cpp | 7 +------ libethash-cl/ethash_cl_miner.h | 3 --- libethcore/EthashGPUMiner.cpp | 2 -- libethcore/EthashGPUMiner.h | 1 - 5 files changed, 1 insertion(+), 19 deletions(-) diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 271e9df91..faff135f0 100644 --- a/ethminer/MinerAux.h +++ b/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 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 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 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]; diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index 080d26cf2..b1d4a2994 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/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 ethash_cl_miner::getDevices(std::vector 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; diff --git a/libethash-cl/ethash_cl_miner.h b/libethash-cl/ethash_cl_miner.h index 4dcbb8310..c3d48d398 100644 --- a/libethash-cl/ethash_cl_miner.h +++ b/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; diff --git a/libethcore/EthashGPUMiner.cpp b/libethcore/EthashGPUMiner.cpp index f90c29895..7ab2cfb74 100644 --- a/libethcore/EthashGPUMiner.cpp +++ b/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 ) diff --git a/libethcore/EthashGPUMiner.h b/libethcore/EthashGPUMiner.h index 5268da8cc..fdef047e9 100644 --- a/libethcore/EthashGPUMiner.h +++ b/libethcore/EthashGPUMiner.h @@ -53,7 +53,6 @@ public: unsigned _globalWorkSizeMultiplier, unsigned _platformId, unsigned _deviceId, - bool _allowCPU, unsigned _extraGPUMemory, uint64_t _currentBlock, unsigned _dagLoadMode,