summaryrefslogtreecommitdiffstats
path: root/cli-miner.cpp
diff options
context:
space:
mode:
authorpsychocrypt <psychocrypt@users.noreply.github.com>2017-09-24 20:07:34 +0200
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-09-30 23:46:08 +0200
commit7d88cf456b70268336970ff584ea0c22deac8bfa (patch)
tree4995f14b6e7f8a0d2f41f023c1f9a6fa88d47f56 /cli-miner.cpp
parent652b79f6845dc8ec823ebe56ba11d39bd861734c (diff)
downloadxmr-stak-7d88cf456b70268336970ff584ea0c22deac8bfa.zip
xmr-stak-7d88cf456b70268336970ff584ea0c22deac8bfa.tar.gz
update rot files
- add config file editor - move telemetry out of minethd
Diffstat (limited to 'cli-miner.cpp')
-rw-r--r--cli-miner.cpp50
1 files changed, 18 insertions, 32 deletions
diff --git a/cli-miner.cpp b/cli-miner.cpp
index 45d2c16..d7d2781 100644
--- a/cli-miner.cpp
+++ b/cli-miner.cpp
@@ -22,15 +22,13 @@
*/
#include "executor.h"
-#include "minethd.h"
+#include "backend/miner_work.h"
+#include "backend/GlobalStates.hpp"
+#include "backend/BackendConnector.hpp"
#include "jconf.h"
#include "console.h"
#include "donate-level.h"
-#ifndef CONF_NO_HWLOC
-# include "autoAdjustHwloc.hpp"
-#else
-# include "autoAdjust.hpp"
-#endif
+
#include "version.h"
#ifndef CONF_NO_HTTPD
@@ -48,19 +46,9 @@
#include <openssl/err.h>
#endif
-//Do a press any key for the windows folk. *insert any key joke here*
-#ifdef _WIN32
-void win_exit()
-{
- printer::inst()->print_str("Press any key to exit.");
- get_key();
- return;
-}
-
-#define strcasecmp _stricmp
-#else
-void win_exit() { return; }
+#ifdef _WIN32
+# define strcasecmp _stricmp
#endif // _WIN32
void do_benchmark();
@@ -109,15 +97,7 @@ int main(int argc, char *argv[])
return 0;
}
- if(jconf::inst()->NeedsAutoconf())
- {
- autoAdjust adjust;
- adjust.printConfig();
- win_exit();
- return 0;
- }
-
- if (!minethd::self_test())
+ if (!xmrstak::BackendConnector::self_test())
{
win_exit();
return 0;
@@ -144,6 +124,12 @@ int main(int argc, char *argv[])
printer::inst()->print_str("-------------------------------------------------------------------\n");
printer::inst()->print_str( XMR_STAK_NAME" " XMR_STAK_VERSION " mining software, CPU Version.\n");
printer::inst()->print_str("Based on CPU mining code by wolf9466 (heavily optimized by fireice_uk).\n");
+#ifndef CONF_NO_CUDA
+ printer::inst()->print_str("NVIDIA mining code was written by KlausT and psychocrypt.\n");
+#endif
+#ifndef CONF_NO_OPENCL
+ printer::inst()->print_str("AMD mining code was written by wolf9466.\n");
+#endif
printer::inst()->print_str("Brought to you by fireice_uk and psychocrypt under GPLv3.\n\n");
char buffer[64];
snprintf(buffer, sizeof(buffer), "Configurable dev donation level is set to %.1f %%\n\n", fDevDonationLevel * 100.0);
@@ -196,20 +182,20 @@ int main(int argc, char *argv[])
void do_benchmark()
{
using namespace std::chrono;
- std::vector<minethd*>* pvThreads;
+ std::vector<xmrstak::IBackend*>* pvThreads;
printer::inst()->print_msg(L0, "Running a 60 second benchmark...");
uint8_t work[76] = {0};
- minethd::miner_work oWork = minethd::miner_work("", work, sizeof(work), 0, 0, false, 0);
- pvThreads = minethd::thread_starter(oWork);
+ xmrstak::miner_work oWork = xmrstak::miner_work("", work, sizeof(work), 0, 0, 0);
+ pvThreads = xmrstak::BackendConnector::thread_starter(oWork);
uint64_t iStartStamp = time_point_cast<milliseconds>(high_resolution_clock::now()).time_since_epoch().count();
std::this_thread::sleep_for(std::chrono::seconds(60));
- oWork = minethd::miner_work();
- minethd::switch_work(oWork);
+ oWork = xmrstak::miner_work();
+ xmrstak::GlobalStates::switch_work(oWork);
double fTotalHps = 0.0;
for (uint32_t i = 0; i < pvThreads->size(); i++)
OpenPOWER on IntegriCloud