summaryrefslogtreecommitdiffstats
path: root/xmrstak/backend/nvidia/jconf.hpp
blob: b4ebaa03549c003ae82b1d7e96e524070f8d47d6 (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
47
48
49
50
51
52
#pragma once
#include <stdlib.h>
#include <string>
#include "xmrstak/params.hpp"

namespace xmrstak
{
namespace nvidia
{

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

	bool parse_config(const char* sFilename = params::inst().configFileNVIDIA.c_str());

	struct thd_cfg {
		uint32_t id;
		uint32_t blocks;
		uint32_t threads;
		uint32_t bfactor;
		uint32_t bsleep;
		bool bDoubleMode;
		bool bNoPrefetch;
		int32_t cpu_aff;
		int syncMode;

		long long iCpuAff;
	};

	size_t GetGPUThreadCount();

	bool GetGPUThreadConfig(size_t id, thd_cfg &cfg);

	bool NeedsAutoconf();

private:
	jconf();
	static jconf* oInst;

	struct opaque_private;
	opaque_private* prv;

};

} // namespace nvidia
} // namespace xmrstak
OpenPOWER on IntegriCloud