Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson options to disable lc0 backends #697

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lc0/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if get_option('build_backends')
tf_protobuf_lib = cc.find_library('libprotobuf',
dirs: tensorflow_libdir, required: false)

if tf_dl_lib.found() and tf_tensorflow_lib.found() and tf_protobuf_lib.found()
if get_option('tf') and tf_dl_lib.found() and tf_tensorflow_lib.found() and tf_protobuf_lib.found()
includes += include_directories(
tensorflow_include,
tensorflow_include[0] + '/bazel-genfiles',
Expand All @@ -121,7 +121,6 @@ if get_option('build_backends')
files += 'src/neural/network_tf.cc'
has_backends = true
endif



## ~~~~~
Expand Down Expand Up @@ -155,7 +154,7 @@ if get_option('build_backends')

endif

if has_blas
if get_option('blas') and has_blas

blas_files = [
'src/neural/transforms.cc',
Expand Down Expand Up @@ -190,14 +189,18 @@ if get_option('build_backends')
endif


if has_opencl and has_blas
if get_option('opencl') and has_opencl and has_blas

opencl_files = [
'src/neural/CL/OpenCL.cc',
'src/neural/CL/OpenCLTuner.cc',
'src/neural/network_opencl.cc',
]

if not get_option('blas')
opencl_files += 'src/neural/transforms.cc'
endif

files += opencl_files
has_backends = true

Expand All @@ -219,7 +222,7 @@ if get_option('build_backends')
'src/neural/network_cudnn.cu',
]

if cu_blas.found() and cu_dnn.found() and cu_dart.found() and nvcc.found()
if get_option('cudnn') and cu_blas.found() and cu_dnn.found() and cu_dart.found() and nvcc.found()
includes += include_directories(get_option('cudnn_include'))
deps += [cu_blas, cu_dnn, cu_dart]
cuda_arguments = ['-c', '@INPUT@', '-o', '@OUTPUT@',
Expand Down
20 changes: 20 additions & 0 deletions lc0/meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,23 @@ option('build_backends',
type: 'boolean',
value: true,
description: 'Build backends for NN computation')

option('blas',
type: 'boolean',
value: true,
description: 'Enable BLAS backend')

option('cudnn',
type: 'boolean',
value: true,
description: 'Enable cuDNN backend')

option('opencl',
type: 'boolean',
value: true,
description: 'Enable OpenCL backend')

option('tf',
type: 'boolean',
value: true,
description: 'Enable TensorFlow backend')