This repository was archived by the owner on Sep 15, 2022. It is now read-only.
File tree 5 files changed +32
-2
lines changed
5 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 3
3
4
4
#include < stdexcept>
5
5
#include < fstream>
6
- #include < CL/cl.h>
7
6
#include < string>
8
7
#include < vector>
9
8
#include < mutex>
10
9
10
+ #if defined(__APPLE__) || defined(__MACOSX)
11
+ #include < OpenCL/cl.h>
12
+ #define clCreateCommandQueueWithProperties clCreateCommandQueue
13
+ #else
14
+ #include < CL/cl.h>
15
+ #endif
16
+
11
17
#include " SpeedSample.hpp"
12
18
#include " CLMemory.hpp"
13
19
#include " types.hpp"
Original file line number Diff line number Diff line change 1
1
CC =g++
2
2
CFLAGS =-c -std=c++11 -Wall -mmmx -O2
3
3
CDEFINES =
4
- LDFLAGS =-s -lOpenCL
5
4
SOURCES =Dispatcher.cpp Mode.cpp precomp.cpp profanity.cpp SpeedSample.cpp
6
5
OBJECTS=$(SOURCES:.cpp =.o)
7
6
EXECUTABLE =profanity.x64
8
7
8
+ UNAME_S := $(shell uname -s)
9
+ ifeq ($(UNAME_S ) ,Darwin)
10
+ LDFLAGS=-framework OpenCL
11
+ else
12
+ LDFLAGS=-s -lOpenCL
13
+ endif
14
+
9
15
all : $(SOURCES ) $(EXECUTABLE )
10
16
11
17
$(EXECUTABLE ) : $(OBJECTS )
Original file line number Diff line number Diff line change 2
2
#define HPP_MODE
3
3
4
4
#include < string>
5
+
6
+ #if defined(__APPLE__) || defined(__MACOSX)
7
+ #include < OpenCL/cl.h>
8
+ #else
5
9
#include < CL/cl.h>
10
+ #endif
6
11
7
12
class Mode {
8
13
private:
Original file line number Diff line number Diff line change 9
9
#include < map>
10
10
#include < set>
11
11
12
+ #if defined(__APPLE__) || defined(__MACOSX)
13
+ #include < OpenCL/cl.h>
14
+ #include < OpenCL/cl_ext.h> // Included to get topology to get an actual unique identifier per device
15
+ #else
12
16
#include < CL/cl.h>
13
17
#include < CL/cl_ext.h> // Included to get topology to get an actual unique identifier per device
18
+ #endif
14
19
15
20
#include " Dispatcher.hpp"
16
21
#include " ArgParser.hpp"
@@ -106,13 +111,17 @@ std::vector<std::string> getBinaries(cl_program & clProgram) {
106
111
}
107
112
108
113
unsigned int getUniqueDeviceIdentifier (const cl_device_id & deviceId) {
114
+ #if defined(__APPLE__) || defined(__MACOSX)
115
+ return 0 ;
116
+ #else
109
117
auto topology = clGetWrapper<cl_device_topology_amd>(clGetDeviceInfo, deviceId, CL_DEVICE_TOPOLOGY_AMD);
110
118
if (topology.raw .type == CL_DEVICE_TOPOLOGY_TYPE_PCIE_AMD) {
111
119
return (topology.pcie .bus << 16 ) + (topology.pcie .device << 8 ) + topology.pcie .function ;
112
120
}
113
121
else {
114
122
return 0 ;
115
123
}
124
+ #endif
116
125
}
117
126
118
127
template <typename T> bool printResult (const T & t, const cl_int & err) {
Original file line number Diff line number Diff line change 4
4
/* The structs declared in this file should have size/alignment hints
5
5
* to ensure that their representation is identical to that in OpenCL.
6
6
*/
7
+ #if defined(__APPLE__) || defined(__MACOSX)
8
+ #include < OpenCL/cl.h>
9
+ #else
7
10
#include < CL/cl.h>
11
+ #endif
8
12
9
13
#define MP_NWORDS 8
10
14
You can’t perform that action at this time.
0 commit comments