@@ -1181,18 +1181,22 @@ void processNeighboursHandler(const int startLayer,
11811181 const float MaxChi2ClusterAttachment,
11821182 const o2::base::Propagator* propagator,
11831183 const o2::base::PropagatorF::MatCorrType matCorrType,
1184- std::vector<int >& updatedCellIdHost, // temporary host vectors
1185- std::vector<CellSeed>& updatedCellSeedHost, // temporary host vectors
1184+ const std::vector<int >& lastCellIdHost, // temporary host vector
1185+ const std::vector<CellSeed>& lastCellSeedHost, // temporary host vector
1186+ std::vector<int >& updatedCellIdHost, // temporary host vector
1187+ std::vector<CellSeed>& updatedCellSeedHost, // temporary host vector
11861188 const int nBlocks,
11871189 const int nThreads)
11881190{
11891191 thrust::device_vector<int > foundSeedsTable (nCurrentCells + 1 ); // Shortcut: device_vector skips central memory management, we are relying on the contingency. TODO: fix this.
1192+ thrust::device_vector<int > lastCellIds (lastCellIdHost);
1193+ thrust::device_vector<CellSeed> lastCellSeed (lastCellSeedHost);
11901194 gpu::processNeighboursKernel<true ><<<nBlocks, nThreads>>> (startLayer,
11911195 startLevel,
11921196 allCellSeeds,
1193- currentCellSeeds,
1194- nullptr , // currentCellIds ,
1195- nCurrentCells,
1197+ lastCellIdHost. empty () ? currentCellSeeds : thrust::raw_pointer_cast (&lastCellSeed[ 0 ]), // lastCellSeeds
1198+ lastCellIdHost. empty () ? nullptr : thrust::raw_pointer_cast (&lastCellIds[ 0 ]), // lastCellIds ,
1199+ lastCellIdHost. empty () ? nCurrentCells : lastCellSeedHost. size () ,
11961200 nullptr , // updatedCellSeeds,
11971201 nullptr , // updatedCellsIds,
11981202 thrust::raw_pointer_cast (&foundSeedsTable[0 ]), // auxiliary only in GPU code to compute the number of cells per iteration
@@ -1220,15 +1224,15 @@ void processNeighboursHandler(const int startLayer,
12201224 nCurrentCells + 1 , // num_items
12211225 0 ));
12221226
1223- thrust::device_vector<int > updatedCellIds (foundSeedsTable.back ()), lastCellIds (foundSeedsTable.back ());
1224- thrust::device_vector<CellSeed> updatedCellSeeds (foundSeedsTable.back ()), lastCellSeeds (foundSeedsTable.back ());
1227+ thrust::device_vector<int > updatedCellIds (foundSeedsTable.back ()) /* , lastCellIds(foundSeedsTable.back())*/ ;
1228+ thrust::device_vector<CellSeed> updatedCellSeeds (foundSeedsTable.back ()) /* , lastCellSeeds(foundSeedsTable.back())*/ ;
12251229
12261230 gpu::processNeighboursKernel<false ><<<nBlocks, nThreads>>> (startLayer,
12271231 startLevel,
12281232 allCellSeeds,
1229- currentCellSeeds,
1230- nullptr , // currentCellIds ,
1231- nCurrentCells,
1233+ lastCellIdHost. empty () ? currentCellSeeds : thrust::raw_pointer_cast (&lastCellSeed[ 0 ]), // lastCellSeeds
1234+ lastCellIdHost. empty () ? nullptr : thrust::raw_pointer_cast (&lastCellIds[ 0 ]), // lastCellIds ,
1235+ lastCellIdHost. empty () ? nCurrentCells : lastCellSeedHost. size () ,
12321236 thrust::raw_pointer_cast (&updatedCellSeeds[0 ]), // updatedCellSeeds
12331237 thrust::raw_pointer_cast (&updatedCellIds[0 ]), // updatedCellsIds
12341238 thrust::raw_pointer_cast (&foundSeedsTable[0 ]), // auxiliary only in GPU code to compute the number of cells per iteration
@@ -1419,8 +1423,10 @@ template void processNeighboursHandler<7>(const int startLayer,
14191423 const float MaxChi2ClusterAttachment,
14201424 const o2::base::Propagator* propagator,
14211425 const o2::base::PropagatorF::MatCorrType matCorrType,
1422- std::vector<int >& updatedCellIdHost, // temporary host vectors
1423- std::vector<CellSeed>& updatedCellSeedHost, // temporary host vectors
1426+ const std::vector<int >& lastCellIdHost, // temporary host vector
1427+ const std::vector<CellSeed>& lastCellSeedHost, // temporary host vector
1428+ std::vector<int >& updatedCellIdHost, // temporary host vector
1429+ std::vector<CellSeed>& updatedCellSeedHost, // temporary host vector
14241430 const int nBlocks,
14251431 const int nThreads);
14261432} // namespace o2::its
0 commit comments