From 13433097a3690a4879ee225e7493122ab3683b9d Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Fri, 10 Nov 2017 22:37:30 +0100 Subject: add backend type - add type of the backend to each backend-plugin - add `gteName` to `iBackend` to get the name of the backend --- xmrstak/backend/iBackend.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'xmrstak/backend/iBackend.hpp') 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 #include #include - +#include +#include 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 backendNames = { + "UNKNOWN", + "CPU", + "AMD", + "NVIDIA" + }; + return backendNames[static_cast(type)]; + } + std::atomic iHashCount; std::atomic iTimestamp; uint32_t iThreadNo; + BackendType backendType = UNKNOWN; iBackend() : iHashCount(0), iTimestamp(0) { -- cgit v1.1