summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/amd/jconf.hpp
blob: db41dffb47f70130a7f8d3773fd065b6b91140e2 (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
40
41
42
43
44
45
46
#pragma once

#include "xmrstak/params.hpp"

#include <stdlib.h>
#include <string>

namespace xmrstak
{
namespace amd
{

class jconf
{
public:
	static jconf* inst()
	{
		if (oInst == nullptr) oInst = new jconf;
		return oInst;
	};

	bool parse_config(const char* sFilename = Params::inst().configFileAMD.c_str());

	struct thd_cfg {
		size_t index;
		size_t intensity;
		size_t w_size;
		long long cpu_aff;
	};

	size_t GetThreadCount();
	bool GetThreadConfig(size_t id, thd_cfg &cfg);

	size_t GetPlatformIdx();

private:
	jconf();
	static jconf* oInst;

	struct opaque_private;
	opaque_private* prv;

};

} // namespace amd
} // namespace xmrstak
OpenPOWER on IntegriCloud