summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/nvidia
diff options
context:
space:
mode:
authorpsychocrypt <psychocrypt@users.noreply.github.com>2017-09-29 22:06:09 +0200
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-09-30 23:46:08 +0200
commit855af1cf65de1fd3795de3c9a859fd9242625a84 (patch)
tree51368c6f1d6cd401969f4beedcbcccc21d055153 /xmrstak/backend/nvidia
parent8babae3156430f5aa6b804f7c352ffb178097963 (diff)
downloadxmr-stak-855af1cf65de1fd3795de3c9a859fd9242625a84.zip
xmr-stak-855af1cf65de1fd3795de3c9a859fd9242625a84.tar.gz
fix compile
Diffstat (limited to 'xmrstak/backend/nvidia')
-rw-r--r--xmrstak/backend/nvidia/autoAdjust.hpp2
-rw-r--r--xmrstak/backend/nvidia/jconf.cpp2
-rw-r--r--xmrstak/backend/nvidia/minethd.cpp30
-rw-r--r--xmrstak/backend/nvidia/minethd.hpp24
4 files changed, 21 insertions, 37 deletions
diff --git a/xmrstak/backend/nvidia/autoAdjust.hpp b/xmrstak/backend/nvidia/autoAdjust.hpp
index 4107510..2354dec 100644
--- a/xmrstak/backend/nvidia/autoAdjust.hpp
+++ b/xmrstak/backend/nvidia/autoAdjust.hpp
@@ -83,7 +83,7 @@ private:
#include "./config.tpl"
;
- ConfigEditor configTpl{};
+ configEditor configTpl{};
configTpl.set( std::string(tpl) );
constexpr size_t byte2mib = 1024u * 1024u;
diff --git a/xmrstak/backend/nvidia/jconf.cpp b/xmrstak/backend/nvidia/jconf.cpp
index 7a94d19..971ff05 100644
--- a/xmrstak/backend/nvidia/jconf.cpp
+++ b/xmrstak/backend/nvidia/jconf.cpp
@@ -22,7 +22,7 @@
*/
#include "jconf.hpp"
-#include "xmrstak/miscjext.hpp"
+#include "xmrstak/misc/jext.hpp"
#include "xmrstak/misc/console.hpp"
#include <stdio.h>
diff --git a/xmrstak/backend/nvidia/minethd.cpp b/xmrstak/backend/nvidia/minethd.cpp
index 7718d34..2e3ef01 100644
--- a/xmrstak/backend/nvidia/minethd.cpp
+++ b/xmrstak/backend/nvidia/minethd.cpp
@@ -26,7 +26,7 @@
#include "xmrstak/misc/console.hpp"
#include "xmrstak/backend/cpu/crypto/cryptonight_aesni.h"
#include "xmrstak/backend/cpu/crypto/cryptonight.h"
-#include "xmrstak/backend/cpu//cpu/minethd.hpp"
+#include "xmrstak/backend/cpu/minethd.hpp"
#include "xmrstak/params.hpp"
#include "xmrstak/misc/executor.hpp"
#include "xmrstak/jconf.hpp"
@@ -110,18 +110,18 @@ extern "C"
#ifdef WIN32
__declspec(dllexport)
#endif
-std::vector<IBackend*>* xmrstak_start_backend(uint32_t threadOffset, miner_work& pWork, Environment& env)
+std::vector<iBackend*>* xmrstak_start_backend(uint32_t threadOffset, miner_work& pWork, environment& env)
{
- Environment::inst() = env;
+ environment::inst() = env;
return nvidia::minethd::thread_starter(threadOffset, pWork);
}
} // extern "C"
-std::vector<IBackend*>* minethd::thread_starter(uint32_t threadOffset, miner_work& pWork)
+std::vector<iBackend*>* minethd::thread_starter(uint32_t threadOffset, miner_work& pWork)
{
- std::vector<IBackend*>* pvThreads = new std::vector<IBackend*>();
+ std::vector<iBackend*>* pvThreads = new std::vector<iBackend*>();
- if(!ConfigEditor::file_exist(Params::inst().configFileNVIDIA))
+ if(!configEditor::file_exist(Params::inst().configFileNVIDIA))
{
autoAdjust adjust;
if(!adjust.printConfig())
@@ -174,19 +174,19 @@ void minethd::switch_work(miner_work& pWork)
// faster than threads can consume them. This should never happen in real life.
// Pool cant physically send jobs faster than every 250ms or so due to net latency.
- while (GlobalStates::inst().iConsumeCnt.load(std::memory_order_seq_cst) < GlobalStates::inst().iThreadCount)
+ while (globalStates::inst().iConsumeCnt.load(std::memory_order_seq_cst) < globalStates::inst().iThreadCount)
std::this_thread::sleep_for(std::chrono::milliseconds(100));
- GlobalStates::inst().oGlobalWork = pWork;
- GlobalStates::inst().iConsumeCnt.store(0, std::memory_order_seq_cst);
- GlobalStates::inst().iGlobalJobNo++;
+ globalStates::inst().oGlobalWork = pWork;
+ globalStates::inst().iConsumeCnt.store(0, std::memory_order_seq_cst);
+ globalStates::inst().iGlobalJobNo++;
}
void minethd::consume_work()
{
- memcpy(&oWork, &GlobalStates::inst().oGlobalWork, sizeof(miner_work));
+ memcpy(&oWork, &globalStates::inst().oGlobalWork, sizeof(miner_work));
iJobNo++;
- GlobalStates::inst().iConsumeCnt++;
+ globalStates::inst().iConsumeCnt++;
}
void minethd::work_main()
@@ -197,7 +197,7 @@ void minethd::work_main()
cpu_ctx = cpu::minethd::minethd_alloc_ctx();
cn_hash_fun hash_fun = cpu::minethd::func_selector(::jconf::inst()->HaveHardwareAes(), true /*bNoPrefetch*/);
- GlobalStates::inst().iConsumeCnt++;
+ globalStates::inst().iConsumeCnt++;
if(/*cuda_get_deviceinfo(&ctx) != 1 ||*/ cryptonight_extra_cpu_init(&ctx) != 1)
{
@@ -213,7 +213,7 @@ void minethd::work_main()
either because of network latency, or a socket problem. Since we are
raison d'etre of this software it us sensible to just wait until we have something*/
- while (GlobalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
+ while (globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
std::this_thread::sleep_for(std::chrono::milliseconds(100));
consume_work();
@@ -225,7 +225,7 @@ void minethd::work_main()
assert(sizeof(job_result::sJobID) == sizeof(pool_job::sJobID));
- while(GlobalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
+ while(globalStates::inst().iGlobalJobNo.load(std::memory_order_relaxed) == iJobNo)
{
uint32_t foundNonce[10];
diff --git a/xmrstak/backend/nvidia/minethd.hpp b/xmrstak/backend/nvidia/minethd.hpp
index ecf189a..657ee6a 100644
--- a/xmrstak/backend/nvidia/minethd.hpp
+++ b/xmrstak/backend/nvidia/minethd.hpp
@@ -2,9 +2,9 @@
#include "xmrstak/jconf.hpp"
#include "jconf.hpp"
-#include "nvcc_code/cryptonight.h"
+#include "nvcc_code/cryptonight.hpp"
-#include "xmrstak/bakcend/cpu/crypto/cryptonight.h"
+#include "xmrstak/backend/cpu/crypto/cryptonight.h"
#include "xmrstak/backend/iBackend.hpp"
#include "xmrstak/misc/environment.hpp"
@@ -19,12 +19,12 @@ namespace xmrstak
namespace nvidia
{
-class minethd : public IBackend
+class minethd : public iBackend
{
public:
static void switch_work(miner_work& pWork);
- static std::vector<IBackend*>* thread_starter(uint32_t threadOffset, miner_work& pWork);
+ static std::vector<iBackend*>* thread_starter(uint32_t threadOffset, miner_work& pWork);
static bool self_test();
private:
@@ -32,21 +32,6 @@ private:
minethd(miner_work& pWork, size_t iNo, const jconf::thd_cfg& cfg);
- // We use the top 10 bits of the nonce for thread and resume
- // This allows us to resume up to 128 threads 4 times before
- // we get nonce collisions
- // Bottom 22 bits allow for an hour of work at 1000 H/s
- inline uint32_t calc_start_nonce(uint32_t resume)
- {
- return reverseBits<uint32_t>(iThreadNo + GlobalStates::inst().iThreadCount * resume);
- }
-
- // Limited version of the nonce calc above
- inline uint32_t calc_nicehash_nonce(uint32_t start, uint32_t resume)
- {
- return start | ( ( reverseBits(iThreadNo + GlobalStates::inst().iThreadCount * resume) >> 4u ) );
- }
-
void work_main();
void consume_work();
@@ -59,7 +44,6 @@ private:
miner_work oWork;
std::thread oWorkThd;
- uint8_t iThreadNo;
nvid_ctx ctx;
OpenPOWER on IntegriCloud