@@ -181,12 +181,7 @@ common_files += [
181181]
182182
183183files += [
184- ' src/benchmark/backendbench.cc' ,
185- ' src/benchmark/benchmark.cc' ,
186184 ' src/engine.cc' ,
187- ' src/lc0ctl/describenet.cc' ,
188- ' src/lc0ctl/leela2onnx.cc' ,
189- ' src/lc0ctl/onnx2leela.cc' ,
190185 ' src/mcts/params.cc' ,
191186 ' src/mcts/search.cc' ,
192187 ' src/mcts/stoppers/alphazero.cc' ,
@@ -197,27 +192,33 @@ files += [
197192 ' src/mcts/stoppers/smooth.cc' ,
198193 ' src/mcts/stoppers/stoppers.cc' ,
199194 ' src/mcts/stoppers/timemgr.cc' ,
195+ ' src/neural/backends/network_check.cc' ,
196+ ' src/neural/backends/network_demux.cc' ,
197+ ' src/neural/backends/network_mux.cc' ,
198+ ' src/neural/backends/network_random.cc' ,
199+ ' src/neural/backends/network_record.cc' ,
200+ ' src/neural/backends/network_rr.cc' ,
201+ ' src/neural/backends/network_trivial.cc' ,
200202 ' src/neural/cache.cc' ,
201203 ' src/neural/factory.cc' ,
202204 ' src/neural/loader.cc' ,
203- ' src/neural/network_check.cc' ,
204- ' src/neural/network_demux.cc' ,
205205 ' src/neural/network_legacy.cc' ,
206- ' src/neural/network_mux.cc' ,
207- ' src/neural/network_random.cc' ,
208- ' src/neural/network_record.cc' ,
209- ' src/neural/network_rr.cc' ,
210- ' src/neural/network_trivial.cc' ,
211206 ' src/neural/onnx/adapters.cc' ,
212207 ' src/neural/onnx/builder.cc' ,
213208 ' src/neural/onnx/converter.cc' ,
214209 ' src/neural/xla/hlo_builder.cc' ,
215210 ' src/neural/xla/onnx2hlo.cc' ,
216211 ' src/neural/xla/print_hlo.cc' ,
212+ ' src/neural/xla/xla_tensor.cc' ,
217213 ' src/selfplay/game.cc' ,
218214 ' src/selfplay/loop.cc' ,
219215 ' src/selfplay/multigame.cc' ,
220216 ' src/selfplay/tournament.cc' ,
217+ ' src/tools/backendbench.cc' ,
218+ ' src/tools/benchmark.cc' ,
219+ ' src/tools/describenet.cc' ,
220+ ' src/tools/leela2onnx.cc' ,
221+ ' src/tools/onnx2leela.cc' ,
221222 ' src/utils/histogram.cc' ,
222223 ' src/utils/numa.cc' ,
223224 ' src/utils/weights_adapter.cc' ,
@@ -248,7 +249,7 @@ if get_option('build_backends')
248249 tf_tensorflow_cc_lib = dependency (' tensorflow_cc' , required : false )
249250 if get_option (' tensorflow' ) and tf_dl_lib.found() and tf_tensorflow_cc_lib.found()
250251 deps += [tf_dl_lib, tf_tensorflow_cc_lib]
251- files += ' src/neural/network_tf_cc.cc'
252+ files += ' src/neural/backends/ network_tf_cc.cc'
252253 has_backends = true
253254 endif
254255
@@ -373,25 +374,25 @@ if get_option('build_backends')
373374 endif
374375
375376 blas_files = [
376- ' src/neural/blas/convolution1.cc' ,
377- ' src/neural/blas/fully_connected_layer.cc' ,
378- ' src/neural/blas/se_unit.cc' ,
379- ' src/neural/blas/network_blas.cc' ,
380- ' src/neural/blas/winograd_convolution3.cc'
377+ ' src/neural/backends/ blas/convolution1.cc' ,
378+ ' src/neural/backends/ blas/fully_connected_layer.cc' ,
379+ ' src/neural/backends/ blas/se_unit.cc' ,
380+ ' src/neural/backends/ blas/network_blas.cc' ,
381+ ' src/neural/backends/ blas/winograd_convolution3.cc'
381382 ]
382383
383384 shared_files = [
384- ' src/neural/shared/activation.cc' ,
385- ' src/neural/shared/winograd_filter.cc' ,
385+ ' src/neural/backends/ shared/activation.cc' ,
386+ ' src/neural/backends/ shared/winograd_filter.cc' ,
386387 ]
387388
388389 files += blas_files
389390 has_backends = true
390391
391392 if get_option (' ispc' ) and ispc.found()
392- files += iscp_gen.process(' src/neural/blas/winograd_transform.ispc' )
393- files += iscp_gen.process(' src/neural/blas/layer_norm.ispc' )
394- files += iscp_gen.process(' src/neural/shared/activation.ispc' )
393+ files += iscp_gen.process(' src/neural/backends/ blas/winograd_transform.ispc' )
394+ files += iscp_gen.process(' src/neural/backends/ blas/layer_norm.ispc' )
395+ files += iscp_gen.process(' src/neural/backends/ shared/activation.ispc' )
395396 add_project_arguments (' -DUSE_ISPC' , language : ' cpp' )
396397 endif
397398
@@ -421,15 +422,15 @@ if get_option('build_backends')
421422 if get_option (' opencl' ) and has_opencl
422423
423424 opencl_files = [
424- ' src/neural/opencl/network_opencl.cc' ,
425- ' src/neural/opencl/OpenCL.cc' ,
426- ' src/neural/opencl/OpenCLTuner.cc' ,
427- ' src/neural/opencl/OpenCLBuffers.cc' ,
425+ ' src/neural/backends/ opencl/network_opencl.cc' ,
426+ ' src/neural/backends/ opencl/OpenCL.cc' ,
427+ ' src/neural/backends/ opencl/OpenCLTuner.cc' ,
428+ ' src/neural/backends/ opencl/OpenCLBuffers.cc' ,
428429 ]
429430
430431 shared_files = [
431- ' src/neural/shared/activation.cc' ,
432- ' src/neural/shared/winograd_filter.cc' ,
432+ ' src/neural/backends/ shared/activation.cc' ,
433+ ' src/neural/backends/ shared/winograd_filter.cc' ,
433434 ]
434435
435436 if not opencl_framework.found()
@@ -455,21 +456,21 @@ if get_option('build_backends')
455456
456457 if (get_option (' cudnn' ) or get_option (' plain_cuda' )) and cu_blas.found() and cu_dart.found() and nvcc.found()
457458 deps += [cu_blas, cu_dart]
458- cuda_files = [' src/neural/cuda/layers.cc' ]
459+ cuda_files = [' src/neural/backends/ cuda/layers.cc' ]
459460 if get_option (' cudnn' ) and cu_dnn.found()
460461 deps += cu_dnn
461- cuda_files += ' src/neural/cuda/network_cudnn.cc'
462- cuda_files += ' src/neural/cuda/network_cuda.cc' # To support newer nets.
462+ cuda_files += ' src/neural/backends/ cuda/network_cudnn.cc'
463+ cuda_files += ' src/neural/backends/ cuda/network_cuda.cc' # To support newer nets.
463464 add_project_arguments (' -DUSE_CUDNN' , language : ' cpp' )
464465 elif get_option (' plain_cuda' )
465- cuda_files += ' src/neural/cuda/network_cuda.cc'
466+ cuda_files += ' src/neural/backends/ cuda/network_cuda.cc'
466467 endif
467468 foreach d : get_option (' cudnn_include' )
468469 if run_command (' scripts/checkdir.py' , d, check : false ).returncode() == 0
469470 includes += include_directories (d, is_system : true )
470471 endif
471472 endforeach
472- includes += include_directories (' src/neural/cuda/' )
473+ includes += include_directories (' src/neural/backends/ cuda/' )
473474
474475 cuda_arguments = [' -c' , ' @INPUT@' , ' -o' , ' @OUTPUT@' ,
475476 ' -I' , meson .current_source_dir() + ' /src' ]
@@ -523,16 +524,16 @@ if get_option('build_backends')
523524 endif
524525 files += cuda_files
525526 files += custom_target (' cuda fp32 code' ,
526- input : ' src/neural/cuda/common_kernels.cu' ,
527+ input : ' src/neural/backends/ cuda/common_kernels.cu' ,
527528 output : outputname,
528- depend_files : ' src/neural/cuda/winograd_helper.inc' ,
529+ depend_files : ' src/neural/backends/ cuda/winograd_helper.inc' ,
529530 command : [nvcc, nvcc_extra_args, cuda_arguments]
530531 )
531532
532533 files += custom_target (' cuda fp16 code' ,
533- input : ' src/neural/cuda/fp16_kernels.cu' ,
534+ input : ' src/neural/backends/ cuda/fp16_kernels.cu' ,
534535 output : outputname,
535- depend_files : ' src/neural/cuda/winograd_helper.inc' ,
536+ depend_files : ' src/neural/backends/ cuda/winograd_helper.inc' ,
536537 command : [nvcc, nvcc_extra_args, cuda_arguments]
537538 )
538539 has_backends = true
@@ -548,14 +549,14 @@ if get_option('build_backends')
548549 dx_dxgi = cc.find_library (' dxgi' )
549550
550551 dx_files = [
551- ' src/neural/dx/network_dx.cc' ,
552- ' src/neural/dx/shader_wrapper.cc' ,
553- ' src/neural/dx/layers_dx.cc' ,
552+ ' src/neural/backends/ dx/network_dx.cc' ,
553+ ' src/neural/backends/ dx/shader_wrapper.cc' ,
554+ ' src/neural/backends/ dx/layers_dx.cc' ,
554555 ]
555556 files += dx_files
556557 deps += [dx_d3d12, dx_dxgi]
557558
558- subdir (' src/neural/dx/shaders' )
559+ subdir (' src/neural/backends/ dx/shaders' )
559560
560561 has_backends = true
561562 endif
@@ -564,8 +565,8 @@ if get_option('build_backends')
564565 includes += include_directories (get_option (' dnnl_dir' ) + ' /include' )
565566 deps += [ dnnl_lib, dependency (' openmp' , required :true ) ]
566567 files += [
567- ' src/neural/onednn/network_onednn.cc' ,
568- ' src/neural/onednn/layers.cc' ,
568+ ' src/neural/backends/ onednn/network_onednn.cc' ,
569+ ' src/neural/backends/ onednn/layers.cc' ,
569570 ]
570571 has_backends = true
571572 endif
@@ -586,7 +587,7 @@ if get_option('build_backends')
586587 includes += include_directories (get_option (' onnx_include' ) + ' /../providers/cpu' ,
587588 is_system : true )
588589 endif
589- files += ' src/neural/onnx /network_onnx.cc'
590+ files += ' src/neural/backends /network_onnx.cc'
590591 if cc.find_library (' onnxruntime_providers_rocm' ,
591592 dirs : get_option (' onnx_libdir' ), required : false ).found()
592593 add_project_arguments (' -DUSE_ROCM' , language : ' cpp' )
@@ -607,9 +608,9 @@ if get_option('build_backends')
607608 deps += metal_frameworks
608609
609610 files += [
610- ' src/neural/metal/network_metal.cc' ,
611- ' src/neural/metal/mps/NetworkGraph.mm' ,
612- ' src/neural/metal/mps/MetalNetworkBuilder.mm' ,
611+ ' src/neural/backends/ metal/network_metal.cc' ,
612+ ' src/neural/backends/ metal/mps/NetworkGraph.mm' ,
613+ ' src/neural/backends/ metal/mps/MetalNetworkBuilder.mm' ,
613614 ]
614615
615616 has_backends = true
@@ -623,10 +624,9 @@ if get_option('build_backends')
623624 ## ~~~~~~~~
624625 if get_option (' xla' )
625626 files += [
626- ' src/neural/xla/network_xla.cc' ,
627- ' src/neural/xla/pjrt.cc' ,
628- ' src/neural/xla/xla_runner.cc' ,
629- ' src/neural/xla/xla_tensor.cc' ,
627+ ' src/neural/backends/xla/network_xla.cc' ,
628+ ' src/neural/backends/xla/pjrt.cc' ,
629+ ' src/neural/backends/xla/xla_runner.cc' ,
630630 ]
631631 deps += cc.find_library (' dl' , required : false )
632632 has_backends = true
@@ -702,7 +702,7 @@ endif
702702if get_option (' rescorer' )
703703 deps += subproject (' gaviotatb' ).get_variable (' gaviotatb_dep' )
704704 executable (' rescorer' , ' src/rescorer_main.cc' ,
705- [common_files, ' src/rescorer /rescoreloop.cc' ],
705+ [common_files, ' src/trainingdata /rescoreloop.cc' ],
706706 include_directories : includes, dependencies : deps, install : true )
707707endif
708708
0 commit comments