From d1172f71b345386d8003f35279b91ffaa54b8b0c Mon Sep 17 00:00:00 2001 From: Marino Missiroli Date: Sun, 18 Aug 2024 11:26:01 +0200 Subject: [PATCH] initialise phiBinner in device-to-host copy of TrackingRecHitsSoACollection Fix to the device-to-host copy of TrackingRecHitsSoACollection, in order to initialise the phiBinner data member on the host side. A more complete explanation of the issue is provided by @makortel in https://github.com/cms-sw/cmssw/issues/45708#issuecomment-2294166204 --- .../interface/alpaka/TrackingRecHitsSoACollection.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h b/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h index 14d0a2e1aa8f0..da3c3bef3928d 100644 --- a/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h +++ b/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h @@ -41,6 +41,16 @@ namespace cms::alpakatools { assert(deviceData.nHits() == hostData.nHits()); assert(deviceData.offsetBPIX2() == hostData.offsetBPIX2()); #endif + // Update the contents address of the phiBinner histo container after the copy from device happened + alpaka::wait(queue); + typename TrackingRecHitSoA::PhiBinnerView pbv; + pbv.assoc = &(hostData.view().phiBinner()); + pbv.offSize = -1; + pbv.offStorage = nullptr; + pbv.contentSize = hostData.nHits(); + pbv.contentStorage = hostData.view().phiBinnerStorage(); + hostData.view().phiBinner().initStorage(pbv); + return hostData; } };