summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/iBackend.hpp
blob: dbfbc993782a9689d65a0745a218ea3616878f8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once

#include "xmrstak/backend/globalStates.hpp"

#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)
		{
		}
	};

} // namepsace xmrstak
OpenPOWER on IntegriCloud