17
17
#include " ./kernels/find_tracks.hpp"
18
18
#include " ./kernels/make_barcode_sequence.hpp"
19
19
#include " ./kernels/propagate_to_next_surface.hpp"
20
- #include " ./kernels/prune_tracks.hpp"
21
20
#include " traccc/definitions/primitives.hpp"
22
21
#include " traccc/definitions/qualifiers.hpp"
23
22
#include " traccc/edm/device/sort_key.hpp"
@@ -306,6 +305,10 @@ finding_algorithm<stepper_t, navigator_t>::operator()(
306
305
::alpaka::wait (queue);
307
306
}
308
307
308
+ if (step == m_cfg.max_track_candidates_per_track - 1 ) {
309
+ break ;
310
+ }
311
+
309
312
if (n_candidates > 0 ) {
310
313
/* ****************************************************************
311
314
* Kernel4: Get key and value for parameter sorting
@@ -413,25 +416,9 @@ finding_algorithm<stepper_t, navigator_t>::operator()(
413
416
m_copy.setup (track_candidates_buffer.headers )->ignore ();
414
417
m_copy.setup (track_candidates_buffer.items )->ignore ();
415
418
416
- // Create buffer for valid indices
417
- vecmem::data::vector_buffer<unsigned int > valid_indices_buffer (n_tips_total,
418
- m_mr.main );
419
-
420
- // Count the number of valid tracks
421
- auto bufHost_n_valid_tracks =
422
- ::alpaka::allocBuf<unsigned int , Idx>(devHost, 1u );
423
- unsigned int * n_valid_tracks =
424
- ::alpaka::getPtrNative (bufHost_n_valid_tracks);
425
- ::alpaka::memset (queue, bufHost_n_valid_tracks, 0 );
426
- ::alpaka::wait (queue);
427
-
428
419
// @Note: nBlocks can be zero in case there is no tip. This happens when
429
420
// chi2_max config is set tightly and no tips are found
430
421
if (n_tips_total > 0 ) {
431
- auto n_valid_tracks_device =
432
- ::alpaka::allocBuf<unsigned int , Idx>(devAcc, 1u );
433
- ::alpaka::memset (queue, n_valid_tracks_device, 0 );
434
-
435
422
Idx blocksPerGrid =
436
423
(n_tips_total + threadsPerBlock - 1 ) / threadsPerBlock;
437
424
auto workDiv = makeWorkDiv<Acc>(blocksPerGrid, threadsPerBlock);
@@ -440,49 +427,15 @@ finding_algorithm<stepper_t, navigator_t>::operator()(
440
427
track_candidates_buffer);
441
428
442
429
::alpaka::exec<Acc>(
443
- queue, workDiv, BuildTracksKernel{}, m_cfg,
430
+ queue, workDiv, BuildTracksKernel{},
444
431
device::build_tracks_payload{
445
432
measurements, vecmem::get_data (seeds_buffer),
446
433
vecmem::get_data (links_buffer), vecmem::get_data (tips_buffer),
447
- track_candidates_view, vecmem::get_data (valid_indices_buffer),
448
- ::alpaka::getPtrNative (n_valid_tracks_device)});
449
- ::alpaka::wait (queue);
450
-
451
- // Global counter object: Device -> Host
452
- ::alpaka::memcpy (queue, bufHost_n_valid_tracks, n_valid_tracks_device);
453
- ::alpaka::wait (queue);
454
- }
455
-
456
- // Create pruned candidate buffer
457
- track_candidate_container_types::buffer prune_candidates_buffer{
458
- {*n_valid_tracks, m_mr.main },
459
- {std::vector<std::size_t >(*n_valid_tracks,
460
- m_cfg.max_track_candidates_per_track ),
461
- m_mr.main , m_mr.host , vecmem::data::buffer_type::resizable}};
462
-
463
- m_copy.setup (prune_candidates_buffer.headers )->ignore ();
464
- m_copy.setup (prune_candidates_buffer.items )->ignore ();
465
-
466
- if (*n_valid_tracks > 0 ) {
467
- Idx blocksPerGrid =
468
- (*n_valid_tracks + threadsPerBlock - 1 ) / threadsPerBlock;
469
- auto workDiv = makeWorkDiv<Acc>(blocksPerGrid, threadsPerBlock);
470
-
471
- track_candidate_container_types::const_view track_candidates_view (
472
- track_candidates_buffer);
473
-
474
- track_candidate_container_types::view prune_candidates_view (
475
- prune_candidates_buffer);
476
-
477
- ::alpaka::exec<Acc>(
478
- queue, workDiv, PruneTracksKernel{},
479
- device::prune_tracks_payload{track_candidates_view,
480
- vecmem::get_data (valid_indices_buffer),
481
- prune_candidates_view});
434
+ track_candidates_view});
482
435
::alpaka::wait (queue);
483
436
}
484
437
485
- return prune_candidates_buffer ;
438
+ return track_candidates_buffer ;
486
439
}
487
440
488
441
// Explicit template instantiation
0 commit comments