You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cpp/CMakeLists.txt
+57-28
Original file line number
Diff line number
Diff line change
@@ -22,24 +22,9 @@ if(NOT WIN32)
22
22
set(ColorBoldRed "${ColorRed}${ColorBold}")
23
23
endif()
24
24
25
-
#--------------------------- CMAKE VARIABLES (partly for Cmake GUI) ----------------------------------------------------
26
-
27
-
set(USE_BACKEND CACHESTRING"Neural net backend")
28
-
string(TOUPPER "${USE_BACKEND}" USE_BACKEND)
29
-
set_property(CACHE USE_BACKEND PROPERTY STRINGS"" CUDA OPENCL EIGEN ONNXRUNTIME)
30
-
31
-
set(USE_TCMALLOC 0 CACHEBOOL"Use TCMalloc")
32
-
set(NO_GIT_REVISION 0 CACHEBOOL"Disable embedding the git revision into the compiled exe")
33
-
set(Boost_USE_STATIC_LIBS_ON 0 CACHEBOOL"Compile against boost statically instead of dynamically")
34
-
set(USE_AVX2 0 CACHEBOOL"Compile with AVX2")
35
-
set(USE_BIGGER_BOARDS_EXPENSIVE 0 CACHEBOOL"Allow boards up to size 29. Compiling with this Will use more memory and slow down KataGo, even when playing on boards of size 19.")
36
-
37
-
#--------------------------- NEURAL NET BACKEND ------------------------------------------------------------------------
38
-
39
-
message(STATUS"Building 'katago' executable for GTP engine and other tools.")
40
-
if(USE_BACKEND STREQUAL"CUDA")
41
-
message(STATUS"-DUSE_BACKEND=CUDA, using CUDA backend.")
25
+
#--------------------------- CUDA MACRO -------------------------------------------------------------------------------
42
26
27
+
macro(CONFIGURE_CUDA)
43
28
# Ensure dynamic cuda linking (Versions prior to 3.17)
#--------------------------- CMAKE VARIABLES (partly for Cmake GUI) ----------------------------------------------------
135
+
136
+
set(USE_BACKEND CACHESTRING"Neural net backend")
137
+
string(TOUPPER "${USE_BACKEND}" USE_BACKEND)
138
+
set_property(CACHE USE_BACKEND PROPERTY STRINGS"" CUDA OPENCL EIGEN ONNXRUNTIME)
139
+
140
+
set(USE_TCMALLOC 0 CACHEBOOL"Use TCMalloc")
141
+
set(NO_GIT_REVISION 0 CACHEBOOL"Disable embedding the git revision into the compiled exe")
142
+
set(Boost_USE_STATIC_LIBS_ON 0 CACHEBOOL"Compile against boost statically instead of dynamically")
143
+
set(USE_AVX2 0 CACHEBOOL"Compile with AVX2")
144
+
set(USE_BIGGER_BOARDS_EXPENSIVE 0 CACHEBOOL"Allow boards up to size 29. Compiling with this Will use more memory and slow down KataGo, even when playing on boards of size 19.")
145
+
146
+
#--------------------------- NEURAL NET BACKEND ------------------------------------------------------------------------
147
+
148
+
message(STATUS"Building 'katago' executable for GTP engine and other tools.")
149
+
if(USE_BACKEND STREQUAL"CUDA")
150
+
message(STATUS"-DUSE_BACKEND=CUDA, using CUDA backend.")
151
+
configure_cuda()
147
152
elseif(USE_BACKEND STREQUAL"OPENCL")
148
153
message(STATUS"-DUSE_BACKEND=OPENCL, using OpenCL backend.")
0 commit comments