forked from bhamon/gpuPlotGenerator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OpenclDevice.h.in
72 lines (54 loc) · 2.22 KB
/
OpenclDevice.h.in
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
GPU plot generator for Burst coin.
Author: Cryo
Bitcoin: 138gMBhCrNkbaiTCmUhP9HLU9xwn5QKZgD
Burst: BURST-YA29-QCEW-QXC3-BKXDL
Based on the code of the official miner and dcct's plotgen.
*/
#ifndef CRYO_GPU_PLOT_GENERATOR_OPENCL_DEVICE_H
#define CRYO_GPU_PLOT_GENERATOR_OPENCL_DEVICE_H
#include <string>
#include <exception>
#include <vector>
#include <memory>
#include <${OpenCL_INCLUDE}>
#include "OpenclPlatform.h"
namespace cryo {
namespace gpuPlotGenerator {
class OpenclDevice {
private:
cl_device_id m_handle;
public:
OpenclDevice(const cl_device_id& p_handle) throw (std::exception);
OpenclDevice(const OpenclDevice& p_other);
virtual ~OpenclDevice() throw ();
OpenclDevice& operator=(const OpenclDevice& p_other);
inline const cl_device_id& getHandle() const;
std::string getType() const throw (std::exception);
std::string getName() const throw (std::exception);
std::string getVendor() const throw (std::exception);
std::string getVersion() const throw (std::exception);
std::string getDriverVersion() const throw (std::exception);
unsigned int getMaxClockFrequency() const throw (std::exception);
unsigned int getMaxComputeUnits() const throw (std::exception);
unsigned long long getGlobalMemorySize() const throw (std::exception);
unsigned long long getMaxMemoryAllocationSize() const throw (std::exception);
std::size_t getMaxWorkGroupSize() const throw (std::exception);
unsigned long long getLocalMemorySize() const throw (std::exception);
std::vector<std::size_t> getMaxWorkItemSizes() const throw (std::exception);
private:
std::string getInfoString(const cl_platform_info& p_paramName) const throw (std::exception);
unsigned int getInfoUint(const cl_platform_info& p_paramName) const throw (std::exception);
std::size_t getInfoSizet(const cl_platform_info& p_paramName) const throw (std::exception);
unsigned long long getInfoUlong(const cl_platform_info& p_paramName) const throw (std::exception);
public:
static std::vector<std::shared_ptr<OpenclDevice>> list(const std::shared_ptr<OpenclPlatform>& p_platform) throw (std::exception);
};
}}
namespace cryo {
namespace gpuPlotGenerator {
inline const cl_device_id& OpenclDevice::getHandle() const {
return m_handle;
}
}}
#endif