summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/iBackend.hpp
diff options
context:
space:
mode:
authorpsychocrypt <psychocrypt@users.noreply.github.com>2017-11-10 22:37:30 +0100
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-11-10 22:37:30 +0100
commit13433097a3690a4879ee225e7493122ab3683b9d (patch)
treec82808cb462153dfc74226767f6065726a319358 /xmrstak/backend/iBackend.hpp
parent22039b2a8755e73fb812e6fa34b75d5665ab10de (diff)
downloadxmr-stak-13433097a3690a4879ee225e7493122ab3683b9d.zip
xmr-stak-13433097a3690a4879ee225e7493122ab3683b9d.tar.gz
add backend type
- add type of the backend to each backend-plugin - add `gteName` to `iBackend` to get the name of the backend
Diffstat (limited to 'xmrstak/backend/iBackend.hpp')
-rw-r--r--xmrstak/backend/iBackend.hpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/xmrstak/backend/iBackend.hpp b/xmrstak/backend/iBackend.hpp
index ab964ce..dbfbc99 100644
--- a/xmrstak/backend/iBackend.hpp
+++ b/xmrstak/backend/iBackend.hpp
@@ -5,15 +5,31 @@
#include <atomic>
#include <cstdint>
#include <climits>
-
+#include <vector>
+#include <string>
namespace xmrstak
{
struct iBackend
{
+
+ enum BackendType : uint32_t { UNKNOWN = 0, CPU = 1u, AMD = 2u, NVIDIA = 3u };
+
+ static std::string getName(const BackendType type)
+ {
+ std::vector<std::string> backendNames = {
+ "UNKNOWN",
+ "CPU",
+ "AMD",
+ "NVIDIA"
+ };
+ return backendNames[static_cast<uint32_t>(type)];
+ }
+
std::atomic<uint64_t> iHashCount;
std::atomic<uint64_t> iTimestamp;
uint32_t iThreadNo;
+ BackendType backendType = UNKNOWN;
iBackend() : iHashCount(0), iTimestamp(0)
{
OpenPOWER on IntegriCloud