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
#--------------------------- 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)
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.")
42
-
25
+
#--------------------------- CUDA MACRO -------------------------------------------------------------------------------
43
26
27
+
macro(CONFIGURE_CUDA)
44
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()
148
152
elseif(USE_BACKEND STREQUAL"OPENCL")
149
153
message(STATUS"-DUSE_BACKEND=OPENCL, using OpenCL backend.")
message(STATUS"-DUSE_BACKEND=ONNXRUNTIME, using ONNXRuntime backend.")
170
+
set(ORT_CUDA 0 CACHEBOOL"Use CUDA execution provider for ONNXRuntime.")
171
+
set(ORT_TENSORRT 0 CACHEBOOL"Use TensorRT execution provider for ONNXRuntime.")
172
+
set(ORT_DIRECTML 0 CACHEBOOL"Use DirectML execution provider for ONNXRuntime.")
173
+
set(ORT_MIGRAPHX 0 CACHEBOOL"Use MIGraphX execution provider for ONNXRuntime.")
174
+
if(ORT_CUDA OR ORT_TENSORRT)
175
+
configure_cuda()
176
+
endif()
177
+
if(ORT_MIGRAPHX)
178
+
set(NEURALNET_BACKEND_SOURCES
179
+
neuralnet/ortbackend.cpp
180
+
neuralnet/openclhelpers.cpp
181
+
)
182
+
else()
183
+
set(NEURALNET_BACKEND_SOURCES
184
+
neuralnet/ortbackend.cpp
185
+
)
186
+
endif()
187
+
164
188
elseif(USE_BACKEND STREQUAL"")
165
-
message(WARNING "${ColorBoldRed}WARNING: Using dummy neural net backend, intended for non-neural-net testing only, will fail on any code path requiring a neural net. To use neural net, specify -DUSE_BACKEND=CUDA or -DUSE_BACKEND=OPENCL or -DUSE_BACKEND=EIGEN to compile with the respective backend.${ColorReset}")
189
+
message(WARNING "${ColorBoldRed}WARNING: Using dummy neural net backend, intended for non-neural-net testing only, will fail on any code path requiring a neural net. To use neural net, specify -DUSE_BACKEND=CUDA or -DUSE_BACKEND=OPENCL or -DUSE_BACKEND=ONNXRUNTIME or -DUSE_BACKEND=EIGEN to compile with the respective backend.${ColorReset}")
0 commit comments