Skip to content

Commit

Permalink
Merge pull request LeelaChessZero#1 from borg323/next
Browse files Browse the repository at this point in the history
meson options to disable lc0 backends
  • Loading branch information
mooskagh authored Jun 1, 2018
2 parents 42a9a61 + 1ba0724 commit ef1df71
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
13 changes: 8 additions & 5 deletions 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/CL/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 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')

0 comments on commit ef1df71

Please sign in to comment.