forked from brichard19/BitCrack
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathclUtil.h
53 lines (39 loc) · 884 Bytes
/
clUtil.h
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
#ifndef _CL_UTIL_H
#define _CL_UTIL_H
#ifdef __APPLE__
#define CL_SILENCE_DEPRECATION
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
#endif
#include <string>
#include <vector>
namespace cl {
std::string getErrorString(cl_int err);
typedef struct {
cl_device_id id;
int cores;
uint64_t mem;
std::string name;
} CLDeviceInfo;
class CLException {
public:
int error;
std::string msg;
CLException(cl_int err)
{
this->error = err;
this->msg = getErrorString(err);
}
CLException(cl_int err, std::string msg)
{
this->error = err;
this->msg = msg;
}
};
CLDeviceInfo getDeviceInfo(int device);
std::vector <CLDeviceInfo> getDevices();
int getDeviceCount();
void clCall(cl_int err);
}
#endif