-
Notifications
You must be signed in to change notification settings - Fork 192
/
OpenCLSearch.lua
113 lines (106 loc) · 4.51 KB
/
OpenCLSearch.lua
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
if os.is("windows") then
local amdopenclpath = os.getenv("AMDAPPSDKROOT")
if( amdopenclpath ) then
amdopenclpath = string.gsub(amdopenclpath, "\\", "/");
local clIncludePath = string.format("%s/include",amdopenclpath);
local clLibPath = string.format("%s/lib/x86",amdopenclpath);
local clLibPath64 = string.format("%s/lib/x86_64",amdopenclpath);
print("OpenCL_Path(AMD)", amdopenclpath)
if (amdopenclpath) then
includedirs {clIncludePath}
-- libdirs {clLibPath}
configuration "x64"
libdirs {clLibPath64}
configuration "x32"
libdirs {clLibPath}
configuration {}
links {"OpenCL"}
end
end
local nvidiaopenclpath = os.getenv("CUDA_PATH")
if( nvidiaopenclpath ) then
defines { "OPENCL_10" }
nvidiaopenclpath = string.gsub(nvidiaopenclpath, "\\", "/");
local clIncludePath = string.format("%s/include",nvidiaopenclpath);
local clLibPath = string.format("%s/lib/Win32",nvidiaopenclpath);
local clLibPath64 = string.format("%s/lib/x64",nvidiaopenclpath);
print("OpenCL_Path(Nvidia)", nvidiaopenclpath)
if (nvidiaopenclpath) then
includedirs {clIncludePath}
-- libdirs {clLibPath}
configuration "x64"
libdirs {clLibPath64}
configuration "x32"
libdirs {clLibPath}
configuration {}
links {"OpenCL"}
end
end
local intelopenclpath = os.getenv("INTELOCLSDKROOT")
if( intelopenclpath ) then
defines { "INTEL_BUG_WORKROUND" }
intelopenclpath = string.gsub(intelopenclpath, "\\", "/");
local clIncludePath = string.format("%s/include",intelopenclpath);
local clLibPath = string.format("%s/lib/x86",intelopenclpath);
local clLibPath64 = string.format("%s/lib/x64",intelopenclpath);
print("OpenCL_Path(Intel)", intelopenclpath)
if (intelopenclpath) then
includedirs {clIncludePath}
-- libdirs {clLibPath}
configuration "x64"
libdirs {clLibPath64}
configuration "x32"
libdirs {clLibPath}
configuration {}
links {"OpenCL"}
end
end
end
if os.is("macosx") then
linkoptions{ "-framework OpenCL" }
end
if os.is("linux") then
local amdopenclpath = os.getenv("AMDAPPSDKROOT")
local nvidiaopenclpath = os.getenv("CUDA_PATH")
if( amdopenclpath ) then
amdopenclpath = string.gsub(amdopenclpath, "\\", "/");
local clIncludePath = string.format("%s/include",amdopenclpath);
local clLibPath = string.format("%s/lib/x86",amdopenclpath);
local clLibPath64 = string.format("%s/lib/x86_64",amdopenclpath);
print("OpenCL_Path(AMD)", amdopenclpath)
if (amdopenclpath) then
includedirs {clIncludePath}
-- libdirs {clLibPath}
configuration "x64"
libdirs {clLibPath64}
configuration "x32"
libdirs {clLibPath}
configuration {}
links {"OpenCL"}
end
elseif( nvidiaopenclpath ) then
defines { "OPENCL_10" }
nvidiaopenclpath = string.gsub(nvidiaopenclpath, "\\", "/");
local clIncludePath = string.format("%s/include",nvidiaopenclpath);
local clLibPath = string.format("%s/lib/Win32",nvidiaopenclpath);
local clLibPath64 = string.format("%s/lib/x64",nvidiaopenclpath);
print("OpenCL_Path(Nvidia)", nvidiaopenclpath)
if (nvidiaopenclpath) then
includedirs {clIncludePath}
-- libdirs {clLibPath}
configuration "x64"
libdirs {clLibPath64}
configuration "x32"
libdirs {clLibPath}
configuration {}
links {"OpenCL"}
end
else
configuration "x64"
libdirs {"/usr/lib/x86_64-linux-gnu"}
configuration "x32"
libdirs {"/usr/lib/i386-linux-gnu"}
configuration {}
links {"OpenCL", "pthread"}
end
end