@@ -181,12 +181,7 @@ common_files += [
181
181
]
182
182
183
183
files += [
184
- ' src/benchmark/backendbench.cc' ,
185
- ' src/benchmark/benchmark.cc' ,
186
184
' src/engine.cc' ,
187
- ' src/lc0ctl/describenet.cc' ,
188
- ' src/lc0ctl/leela2onnx.cc' ,
189
- ' src/lc0ctl/onnx2leela.cc' ,
190
185
' src/mcts/params.cc' ,
191
186
' src/mcts/search.cc' ,
192
187
' src/mcts/stoppers/alphazero.cc' ,
@@ -197,27 +192,33 @@ files += [
197
192
' src/mcts/stoppers/smooth.cc' ,
198
193
' src/mcts/stoppers/stoppers.cc' ,
199
194
' 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' ,
200
202
' src/neural/cache.cc' ,
201
203
' src/neural/factory.cc' ,
202
204
' src/neural/loader.cc' ,
203
- ' src/neural/network_check.cc' ,
204
- ' src/neural/network_demux.cc' ,
205
205
' 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' ,
211
206
' src/neural/onnx/adapters.cc' ,
212
207
' src/neural/onnx/builder.cc' ,
213
208
' src/neural/onnx/converter.cc' ,
214
209
' src/neural/xla/hlo_builder.cc' ,
215
210
' src/neural/xla/onnx2hlo.cc' ,
216
211
' src/neural/xla/print_hlo.cc' ,
212
+ ' src/neural/xla/xla_tensor.cc' ,
217
213
' src/selfplay/game.cc' ,
218
214
' src/selfplay/loop.cc' ,
219
215
' src/selfplay/multigame.cc' ,
220
216
' 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' ,
221
222
' src/utils/histogram.cc' ,
222
223
' src/utils/numa.cc' ,
223
224
' src/utils/weights_adapter.cc' ,
@@ -248,7 +249,7 @@ if get_option('build_backends')
248
249
tf_tensorflow_cc_lib = dependency (' tensorflow_cc' , required : false )
249
250
if get_option (' tensorflow' ) and tf_dl_lib.found() and tf_tensorflow_cc_lib.found()
250
251
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'
252
253
has_backends = true
253
254
endif
254
255
@@ -373,25 +374,25 @@ if get_option('build_backends')
373
374
endif
374
375
375
376
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'
381
382
]
382
383
383
384
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' ,
386
387
]
387
388
388
389
files += blas_files
389
390
has_backends = true
390
391
391
392
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' )
395
396
add_project_arguments (' -DUSE_ISPC' , language : ' cpp' )
396
397
endif
397
398
@@ -421,15 +422,15 @@ if get_option('build_backends')
421
422
if get_option (' opencl' ) and has_opencl
422
423
423
424
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' ,
428
429
]
429
430
430
431
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' ,
433
434
]
434
435
435
436
if not opencl_framework.found()
@@ -455,21 +456,21 @@ if get_option('build_backends')
455
456
456
457
if (get_option (' cudnn' ) or get_option (' plain_cuda' )) and cu_blas.found() and cu_dart.found() and nvcc.found()
457
458
deps += [cu_blas, cu_dart]
458
- cuda_files = [' src/neural/cuda/layers.cc' ]
459
+ cuda_files = [' src/neural/backends/ cuda/layers.cc' ]
459
460
if get_option (' cudnn' ) and cu_dnn.found()
460
461
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.
463
464
add_project_arguments (' -DUSE_CUDNN' , language : ' cpp' )
464
465
elif get_option (' plain_cuda' )
465
- cuda_files += ' src/neural/cuda/network_cuda.cc'
466
+ cuda_files += ' src/neural/backends/ cuda/network_cuda.cc'
466
467
endif
467
468
foreach d : get_option (' cudnn_include' )
468
469
if run_command (' scripts/checkdir.py' , d, check : false ).returncode() == 0
469
470
includes += include_directories (d, is_system : true )
470
471
endif
471
472
endforeach
472
- includes += include_directories (' src/neural/cuda/' )
473
+ includes += include_directories (' src/neural/backends/ cuda/' )
473
474
474
475
cuda_arguments = [' -c' , ' @INPUT@' , ' -o' , ' @OUTPUT@' ,
475
476
' -I' , meson .current_source_dir() + ' /src' ]
@@ -523,16 +524,16 @@ if get_option('build_backends')
523
524
endif
524
525
files += cuda_files
525
526
files += custom_target (' cuda fp32 code' ,
526
- input : ' src/neural/cuda/common_kernels.cu' ,
527
+ input : ' src/neural/backends/ cuda/common_kernels.cu' ,
527
528
output : outputname,
528
- depend_files : ' src/neural/cuda/winograd_helper.inc' ,
529
+ depend_files : ' src/neural/backends/ cuda/winograd_helper.inc' ,
529
530
command : [nvcc, nvcc_extra_args, cuda_arguments]
530
531
)
531
532
532
533
files += custom_target (' cuda fp16 code' ,
533
- input : ' src/neural/cuda/fp16_kernels.cu' ,
534
+ input : ' src/neural/backends/ cuda/fp16_kernels.cu' ,
534
535
output : outputname,
535
- depend_files : ' src/neural/cuda/winograd_helper.inc' ,
536
+ depend_files : ' src/neural/backends/ cuda/winograd_helper.inc' ,
536
537
command : [nvcc, nvcc_extra_args, cuda_arguments]
537
538
)
538
539
has_backends = true
@@ -548,14 +549,14 @@ if get_option('build_backends')
548
549
dx_dxgi = cc.find_library (' dxgi' )
549
550
550
551
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' ,
554
555
]
555
556
files += dx_files
556
557
deps += [dx_d3d12, dx_dxgi]
557
558
558
- subdir (' src/neural/dx/shaders' )
559
+ subdir (' src/neural/backends/ dx/shaders' )
559
560
560
561
has_backends = true
561
562
endif
@@ -564,8 +565,8 @@ if get_option('build_backends')
564
565
includes += include_directories (get_option (' dnnl_dir' ) + ' /include' )
565
566
deps += [ dnnl_lib, dependency (' openmp' , required :true ) ]
566
567
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' ,
569
570
]
570
571
has_backends = true
571
572
endif
@@ -586,7 +587,7 @@ if get_option('build_backends')
586
587
includes += include_directories (get_option (' onnx_include' ) + ' /../providers/cpu' ,
587
588
is_system : true )
588
589
endif
589
- files += ' src/neural/onnx /network_onnx.cc'
590
+ files += ' src/neural/backends /network_onnx.cc'
590
591
if cc.find_library (' onnxruntime_providers_rocm' ,
591
592
dirs : get_option (' onnx_libdir' ), required : false ).found()
592
593
add_project_arguments (' -DUSE_ROCM' , language : ' cpp' )
@@ -607,9 +608,9 @@ if get_option('build_backends')
607
608
deps += metal_frameworks
608
609
609
610
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' ,
613
614
]
614
615
615
616
has_backends = true
@@ -623,10 +624,9 @@ if get_option('build_backends')
623
624
## ~~~~~~~~
624
625
if get_option (' xla' )
625
626
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' ,
630
630
]
631
631
deps += cc.find_library (' dl' , required : false )
632
632
has_backends = true
@@ -702,7 +702,7 @@ endif
702
702
if get_option (' rescorer' )
703
703
deps += subproject (' gaviotatb' ).get_variable (' gaviotatb_dep' )
704
704
executable (' rescorer' , ' src/rescorer_main.cc' ,
705
- [common_files, ' src/rescorer /rescoreloop.cc' ],
705
+ [common_files, ' src/trainingdata /rescoreloop.cc' ],
706
706
include_directories : includes, dependencies : deps, install : true )
707
707
endif
708
708
0 commit comments