diff --git a/Configuration/StandardSequences/python/Services_cff.py b/Configuration/StandardSequences/python/Services_cff.py index f081a8817f361..acb3ad70b050f 100644 --- a/Configuration/StandardSequences/python/Services_cff.py +++ b/Configuration/StandardSequences/python/Services_cff.py @@ -20,8 +20,7 @@ def _addProcessAcceleratorsAlpaka(process): from Configuration.ProcessModifiers.pixelNtupletFit_cff import pixelNtupletFit from Configuration.ProcessModifiers.alpaka_cff import alpaka -modifyConfigurationStandardSequencesServicesAddProcessAccelerators_ = (gpu | pixelNtupletFit ).makeProcessModifier(_addProcessAccelerators) - +modifyConfigurationStandardSequencesServicesAddProcessAccelerators_ = (gpu | pixelNtupletFit | alpaka).makeProcessModifier(_addProcessAccelerators) modifyConfigurationStandardSequencesServicesAddProcessAcceleratorsAlpaka_ = alpaka.makeProcessModifier(_addProcessAcceleratorsAlpaka) diff --git a/DQM/SiPixelHeterogeneous/plugins/BuildFile.xml b/DQM/SiPixelHeterogeneous/plugins/BuildFile.xml index 8cf73f08268d7..79925fdcb6cf8 100644 --- a/DQM/SiPixelHeterogeneous/plugins/BuildFile.xml +++ b/DQM/SiPixelHeterogeneous/plugins/BuildFile.xml @@ -7,7 +7,7 @@ - + diff --git a/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareRecHitsSoAAlpaka.cc b/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareRecHitsSoAAlpaka.cc index 5a7ba189ab440..53a3b9163aca9 100644 --- a/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareRecHitsSoAAlpaka.cc +++ b/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareRecHitsSoAAlpaka.cc @@ -4,8 +4,8 @@ #include "DataFormats/Math/interface/approx_atan2.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" diff --git a/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareTrackSoAAlpaka.cc b/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareTrackSoAAlpaka.cc index 92ca7cae6d3e1..1d85f11053034 100644 --- a/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareTrackSoAAlpaka.cc +++ b/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareTrackSoAAlpaka.cc @@ -24,7 +24,7 @@ #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" // DataFormats -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" namespace { @@ -68,7 +68,7 @@ namespace { template class SiPixelCompareTrackSoAAlpaka : public DQMEDAnalyzer { public: - using PixelTrackSoA = TrackSoAHost; + using PixelTrackSoA = TracksHost; explicit SiPixelCompareTrackSoAAlpaka(const edm::ParameterSet&); ~SiPixelCompareTrackSoAAlpaka() override = default; diff --git a/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareVertexSoAAlpaka.cc b/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareVertexSoAAlpaka.cc index 1706cf54741bc..f1d6ff40d3208 100644 --- a/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareVertexSoAAlpaka.cc +++ b/DQM/SiPixelHeterogeneous/plugins/SiPixelCompareVertexSoAAlpaka.cc @@ -18,7 +18,7 @@ #include "DQMServices/Core/interface/MonitorElement.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" #include "DataFormats/BeamSpot/interface/BeamSpot.h" class SiPixelCompareVertexSoAAlpaka : public DQMEDAnalyzer { diff --git a/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorRecHitsSoAAlpaka.cc b/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorRecHitsSoAAlpaka.cc index 25de77e0bca1c..237aef74eb5df 100644 --- a/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorRecHitsSoAAlpaka.cc +++ b/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorRecHitsSoAAlpaka.cc @@ -4,7 +4,7 @@ #include "DataFormats/Math/interface/approx_atan2.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" diff --git a/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorTrackSoAAlpaka.cc b/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorTrackSoAAlpaka.cc index 8c205aec6cb9c..7cbcc03098e56 100644 --- a/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorTrackSoAAlpaka.cc +++ b/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorTrackSoAAlpaka.cc @@ -23,12 +23,12 @@ #include "DQMServices/Core/interface/MonitorElement.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" template class SiPixelMonitorTrackSoAAlpaka : public DQMEDAnalyzer { public: - using PixelTrackHeterogeneous = TrackSoAHost; + using PixelTrackHeterogeneous = TracksHost; explicit SiPixelMonitorTrackSoAAlpaka(const edm::ParameterSet&); ~SiPixelMonitorTrackSoAAlpaka() override = default; void bookHistograms(DQMStore::IBooker& ibooker, edm::Run const& iRun, edm::EventSetup const& iSetup) override; diff --git a/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorVertexSoAAlpaka.cc b/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorVertexSoAAlpaka.cc index eaaa499f0009a..d3121f77bccb8 100644 --- a/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorVertexSoAAlpaka.cc +++ b/DQM/SiPixelHeterogeneous/plugins/SiPixelMonitorVertexSoAAlpaka.cc @@ -21,7 +21,7 @@ #include "DQMServices/Core/interface/MonitorElement.h" #include "DQMServices/Core/interface/DQMEDAnalyzer.h" #include "DQMServices/Core/interface/DQMStore.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" #include "DataFormats/BeamSpot/interface/BeamSpot.h" class SiPixelMonitorVertexSoAAlpaka : public DQMEDAnalyzer { diff --git a/DQM/SiPixelHeterogeneous/python/SiPixelHeterogenousDQM_FirstStep_cff.py b/DQM/SiPixelHeterogeneous/python/SiPixelHeterogenousDQM_FirstStep_cff.py index 967152e9ca6c2..95245a3fea968 100644 --- a/DQM/SiPixelHeterogeneous/python/SiPixelHeterogenousDQM_FirstStep_cff.py +++ b/DQM/SiPixelHeterogeneous/python/SiPixelHeterogenousDQM_FirstStep_cff.py @@ -56,8 +56,6 @@ from DQM.SiPixelHeterogeneous.siPixelPhase2CompareTrackSoAAlpaka_cfi import * from DQM.SiPixelHeterogeneous.siPixelHIonPhase1CompareTrackSoAAlpaka_cfi import * from DQM.SiPixelHeterogeneous.siPixelCompareVertexSoAAlpaka_cfi import * -# from DQM.SiPixelHeterogeneous.siPixelPhase1RawDataErrorComparator_cfi import * -# from DQM.SiPixelPhase1Common.SiPixelPhase1RawData_cfi import * # digi errors SiPixelPhase1RawDataConfForCPU = copy.deepcopy(SiPixelPhase1RawDataConf) diff --git a/DataFormats/BeamSpot/interface/alpaka/BeamSpotDevice.h b/DataFormats/BeamSpot/interface/alpaka/BeamSpotDevice.h index cc5a08b68bf2c..41e4b87c0d026 100644 --- a/DataFormats/BeamSpot/interface/alpaka/BeamSpotDevice.h +++ b/DataFormats/BeamSpot/interface/alpaka/BeamSpotDevice.h @@ -17,3 +17,6 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { ASSERT_DEVICE_MATCHES_HOST_COLLECTION(BeamSpotDevice, BeamSpotHost); #endif // DataFormats_BeamSpot_interface_alpaka_BeamSpotDevice_h + +// check that the portable device collection for the host device is the same as the portable host collection +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(BeamSpotDevice, BeamSpotHost); \ No newline at end of file diff --git a/DataFormats/Portable/interface/PortableObject.h b/DataFormats/Portable/interface/PortableObject.h index 90a33b49d0f0a..a99a1db01c684 100644 --- a/DataFormats/Portable/interface/PortableObject.h +++ b/DataFormats/Portable/interface/PortableObject.h @@ -4,6 +4,9 @@ #include #include "HeterogeneousCore/AlpakaInterface/interface/traits.h" +// This header is not used by PortableObject, but is included here to automatically +// provide its content to users of ALPAKA_ACCELERATOR_NAMESPACE::PortableObject. +#include "HeterogeneousCore/AlpakaInterface/interface/AssertDeviceMatchesHostCollection.h" namespace traits { diff --git a/DataFormats/SiPixelClusterSoA/BuildFile.xml b/DataFormats/SiPixelClusterSoA/BuildFile.xml index 3a2a296938a28..c9b7e4ef81817 100644 --- a/DataFormats/SiPixelClusterSoA/BuildFile.xml +++ b/DataFormats/SiPixelClusterSoA/BuildFile.xml @@ -1,4 +1,3 @@ - diff --git a/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h b/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h similarity index 79% rename from DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h rename to DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h index 7dd900e7a3e8c..cf5b5b59e22a5 100644 --- a/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h +++ b/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h @@ -1,5 +1,5 @@ -#ifndef DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersCollection_h -#define DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersCollection_h +#ifndef DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersSoACollection_h +#define DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersSoACollection_h #include @@ -11,7 +11,7 @@ #include "HeterogeneousCore/AlpakaInterface/interface/config.h" namespace ALPAKA_ACCELERATOR_NAMESPACE { - using SiPixelClustersCollection = + using SiPixelClustersSoACollection = std::conditional_t, SiPixelClustersHost, SiPixelClustersDevice>; } // namespace ALPAKA_ACCELERATOR_NAMESPACE @@ -23,10 +23,13 @@ namespace cms::alpakatools { SiPixelClustersHost dstData(srcData->metadata().size(), queue); alpaka::memcpy(queue, dstData.buffer(), srcData.buffer()); dstData.setNClusters(srcData.nClusters(), srcData.offsetBPIX2()); + #ifdef GPU_DEBUG //keeping this untiil copies are in the Tracer + printf("SiPixelClustersSoACollection: I'm copying to host.\n"); + #endif return dstData; } }; } // namespace cms::alpakatools -ASSERT_DEVICE_MATCHES_HOST_COLLECTION(SiPixelClustersCollection, SiPixelClustersHost); -#endif // DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersCollection_h +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(SiPixelClustersSoACollection, SiPixelClustersHost); +#endif // DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersSoACollection_h diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h index ee177cb60b93c..e54864699fb73 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h @@ -3,6 +3,6 @@ #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/DeviceProduct.h" -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #endif // DataFormats_SiPixelClusterSoA_src_alpaka_classes_cuda_h diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml index 529b72d3fe830..b9858c3fbffdd 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml @@ -1,6 +1,6 @@ - - - + + + diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h index 187fc15f7012f..bd510fa1618b0 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h @@ -3,6 +3,6 @@ #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/DeviceProduct.h" -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #endif // DataFormats_SiPixelClusterSoA_src_alpaka_classes_rocm_h diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml index a8d914519f51d..d27887904579c 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml @@ -1,6 +1,6 @@ - - - + + + diff --git a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc index 86871ed1ed85b..d96469858b916 100644 --- a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc +++ b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc @@ -1,6 +1,6 @@ #include -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" @@ -29,7 +29,7 @@ int main() { { // Instantiate tracks on device. PortableDeviceCollection allocates // SoA on device automatically. - SiPixelClustersCollection clusters_d(100, queue); + SiPixelClustersSoACollection clusters_d(100, queue); testClusterSoA::runKernels(clusters_d.view(), queue); // Instantate tracks on host. This is where the data will be diff --git a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.dev.cc b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.dev.cc index dd903f3eec759..684380dcbdfbc 100644 --- a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.dev.cc +++ b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.dev.cc @@ -1,4 +1,4 @@ -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" diff --git a/DataFormats/SiPixelDigiSoA/BuildFile.xml b/DataFormats/SiPixelDigiSoA/BuildFile.xml index 538802f92c3ca..53e105366aaf8 100644 --- a/DataFormats/SiPixelDigiSoA/BuildFile.xml +++ b/DataFormats/SiPixelDigiSoA/BuildFile.xml @@ -1,4 +1,3 @@ - diff --git a/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h b/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h index a949964fa445a..1748069685923 100644 --- a/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h +++ b/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h @@ -6,20 +6,20 @@ #include #include "DataFormats/Portable/interface/PortableDeviceCollection.h" -#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" template -class SiPixelDigisDevice : public PortableDeviceCollection { +class SiPixelDigisDevice : public PortableDeviceCollection { public: SiPixelDigisDevice() = default; template explicit SiPixelDigisDevice(size_t maxFedWords, TQueue queue) - : PortableDeviceCollection(maxFedWords + 1, queue) {} + : PortableDeviceCollection(maxFedWords + 1, queue) {} // Constructor which specifies the SoA size explicit SiPixelDigisDevice(size_t maxFedWords, TDev const &device) - : PortableDeviceCollection(maxFedWords + 1, device) {} + : PortableDeviceCollection(maxFedWords + 1, device) {} void setNModulesDigis(uint32_t nModules, uint32_t nDigis) { nModules_h = nModules; diff --git a/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h b/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h index c2cb7e683b00b..4e4650efac1cb 100644 --- a/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h +++ b/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h @@ -2,17 +2,17 @@ #define DataFormats_SiPixelDigiSoA_interface_SiPixelDigisHost_h #include "DataFormats/Portable/interface/PortableHostCollection.h" -#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" // TODO: The class is created via inheritance of the PortableDeviceCollection. // This is generally discouraged, and should be done via composition. // See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306 -class SiPixelDigisHost : public PortableHostCollection { +class SiPixelDigisHost : public PortableHostCollection { public: SiPixelDigisHost() = default; template explicit SiPixelDigisHost(size_t maxFedWords, TQueue queue) - : PortableHostCollection(maxFedWords + 1, queue) {} + : PortableHostCollection(maxFedWords + 1, queue) {} void setNModulesDigis(uint32_t nModules, uint32_t nDigis) { nModules_h = nModules; diff --git a/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h b/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h similarity index 54% rename from DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h rename to DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h index c40bb38fb04b3..2c7c5e1079513 100644 --- a/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h +++ b/DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h @@ -1,5 +1,5 @@ -#ifndef DataFormats_SiPixelDigiSoA_interface_SiPixelDigisSoAv2_h -#define DataFormats_SiPixelDigiSoA_interface_SiPixelDigisSoAv2_h +#ifndef DataFormats_SiPixelDigiSoA_interface_SiPixelDigisSoA_h +#define DataFormats_SiPixelDigiSoA_interface_SiPixelDigisSoA_h #include "DataFormats/SoATemplate/interface/SoALayout.h" @@ -12,8 +12,8 @@ GENERATE_SOA_LAYOUT(SiPixelDigisLayout, SOA_COLUMN(uint16_t, yy), SOA_COLUMN(uint16_t, moduleId)) -using SiPixelDigisSoAv2 = SiPixelDigisLayout<>; -using SiPixelDigisSoAv2View = SiPixelDigisSoAv2::View; -using SiPixelDigisSoAv2ConstView = SiPixelDigisSoAv2::ConstView; +using SiPixelDigisSoA = SiPixelDigisLayout<>; +using SiPixelDigisSoAView = SiPixelDigisSoA::View; +using SiPixelDigisSoAConstView = SiPixelDigisSoA::ConstView; -#endif // DataFormats_SiPixelDigiSoA_interface_SiPixelDigisSoAv2_h +#endif // DataFormats_SiPixelDigiSoA_interface_SiPixelDigisSoA_h diff --git a/DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h b/DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h similarity index 57% rename from DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h rename to DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h index a7b0dee3e666d..1f777634ed194 100644 --- a/DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h +++ b/DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h @@ -1,10 +1,11 @@ -#ifndef DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigiErrorsCollection_h -#define DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigiErrorsCollection_h +#ifndef DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigiErrorsSoACollection_h +#define DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigiErrorsSoACollection_h #include #include +#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsHost.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsDevice.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" @@ -12,24 +13,27 @@ #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" namespace ALPAKA_ACCELERATOR_NAMESPACE { -#ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED - using SiPixelDigiErrorsCollection = SiPixelDigiErrorsHost; -#else - using SiPixelDigiErrorsCollection = SiPixelDigiErrorsDevice; -#endif + +using SiPixelDigiErrorsSoACollection = + std::conditional_t, SiPixelDigiErrorsHost, SiPixelDigiErrorsDevice>; + } // namespace ALPAKA_ACCELERATOR_NAMESPACE namespace cms::alpakatools { - template <> - struct CopyToHost { + template + struct CopyToHost> { template - static auto copyAsync(TQueue& queue, ALPAKA_ACCELERATOR_NAMESPACE::SiPixelDigiErrorsCollection const& srcData) { + static auto copyAsync(TQueue& queue, SiPixelDigiErrorsDevice const& srcData) { SiPixelDigiErrorsHost dstData(srcData.maxFedWords(), queue); alpaka::memcpy(queue, dstData.buffer(), srcData.buffer()); - + #ifdef GPU_DEBUG + printf("SiPixelDigiErrorsSoACollection: I'm copying to host.\n"); + #endif return dstData; } }; } // namespace cms::alpakatools -#endif // DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigiErrorsCollection_h +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(SiPixelDigiErrorsSoACollection, SiPixelDigiErrorsHost); + +#endif // DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigiErrorsSoACollection_h diff --git a/DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h b/DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h similarity index 64% rename from DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h rename to DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h index 13d7217471d4e..b003936817797 100644 --- a/DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h +++ b/DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h @@ -1,10 +1,11 @@ -#ifndef DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisCollection_h -#define DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisCollection_h +#ifndef DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisSoACollection_h +#define DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisSoACollection_h #include #include +#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h" #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" @@ -12,19 +13,16 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { -#ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED - using SiPixelDigisCollection = SiPixelDigisHost; -#else - using SiPixelDigisCollection = SiPixelDigisDevice; -#endif +using SiPixelDigisSoACollection = + std::conditional_t, SiPixelDigisHost, SiPixelDigisDevice>; } // namespace ALPAKA_ACCELERATOR_NAMESPACE namespace cms::alpakatools { - template <> - struct CopyToHost { + template + struct CopyToHost> { template - static auto copyAsync(TQueue &queue, ALPAKA_ACCELERATOR_NAMESPACE::SiPixelDigisCollection const &srcData) { + static auto copyAsync(TQueue &queue, SiPixelDigisDevice const &srcData) { SiPixelDigisHost dstData(srcData.view().metadata().size(), queue); alpaka::memcpy(queue, dstData.buffer(), srcData.buffer()); dstData.setNModulesDigis(srcData.nModules(), srcData.nDigis()); @@ -33,4 +31,6 @@ namespace cms::alpakatools { }; } // namespace cms::alpakatools -#endif // DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisCollection_h +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(SiPixelDigisSoACollection, SiPixelDigisHost); + +#endif // DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisSoACollection_h diff --git a/DataFormats/SiPixelDigiSoA/src/alpaka/classes_cuda.h b/DataFormats/SiPixelDigiSoA/src/alpaka/classes_cuda.h index b35504bcf8fe4..d2fb20448545c 100644 --- a/DataFormats/SiPixelDigiSoA/src/alpaka/classes_cuda.h +++ b/DataFormats/SiPixelDigiSoA/src/alpaka/classes_cuda.h @@ -5,8 +5,8 @@ #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsSoA.h" -#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" #endif // DataFormats_SiPixelDigiSoA_src_alpaka_classes_cuda_h diff --git a/DataFormats/SiPixelDigiSoA/src/alpaka/classes_cuda_def.xml b/DataFormats/SiPixelDigiSoA/src/alpaka/classes_cuda_def.xml index b4e424acf4a57..7315bc37eeb1b 100644 --- a/DataFormats/SiPixelDigiSoA/src/alpaka/classes_cuda_def.xml +++ b/DataFormats/SiPixelDigiSoA/src/alpaka/classes_cuda_def.xml @@ -1,15 +1,15 @@ - - - - - - + + + + + + - - - - + + + + diff --git a/DataFormats/SiPixelDigiSoA/src/alpaka/classes_rocm.h b/DataFormats/SiPixelDigiSoA/src/alpaka/classes_rocm.h index 5bad5c38e4255..db5bf9385f99d 100644 --- a/DataFormats/SiPixelDigiSoA/src/alpaka/classes_rocm.h +++ b/DataFormats/SiPixelDigiSoA/src/alpaka/classes_rocm.h @@ -6,8 +6,8 @@ #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsSoA.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" #endif // DataFormats_SiPixelDigiSoA_src_alpaka_classes_cuda_h diff --git a/DataFormats/SiPixelDigiSoA/src/alpaka/classes_rocm_def.xml b/DataFormats/SiPixelDigiSoA/src/alpaka/classes_rocm_def.xml index a63bf5df92b26..21deb7bbd46dc 100644 --- a/DataFormats/SiPixelDigiSoA/src/alpaka/classes_rocm_def.xml +++ b/DataFormats/SiPixelDigiSoA/src/alpaka/classes_rocm_def.xml @@ -1,15 +1,15 @@ - - - - - - + + + + + + - - - - + + + + diff --git a/DataFormats/SiPixelDigiSoA/src/classes.cc b/DataFormats/SiPixelDigiSoA/src/classes.cc new file mode 100644 index 0000000000000..9022a3102107e --- /dev/null +++ b/DataFormats/SiPixelDigiSoA/src/classes.cc @@ -0,0 +1,6 @@ +#include "DataFormats/Portable/interface/PortableHostCollectionReadRules.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsSoA.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" + +SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection); +SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection); diff --git a/DataFormats/SiPixelDigiSoA/src/classes.h b/DataFormats/SiPixelDigiSoA/src/classes.h index d6a5bd2a915e8..427a4c972863d 100644 --- a/DataFormats/SiPixelDigiSoA/src/classes.h +++ b/DataFormats/SiPixelDigiSoA/src/classes.h @@ -5,6 +5,6 @@ #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsHost.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsSoA.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h" -#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" #endif // DataFormats_SiPixelClusterSoA_src_classes_h diff --git a/DataFormats/SiPixelDigiSoA/src/classes_def.xml b/DataFormats/SiPixelDigiSoA/src/classes_def.xml index 30f613e625cb5..aca144e2a4e34 100644 --- a/DataFormats/SiPixelDigiSoA/src/classes_def.xml +++ b/DataFormats/SiPixelDigiSoA/src/classes_def.xml @@ -1,38 +1,13 @@ - - - - - ::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - - + + + - - - ::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - - diff --git a/DataFormats/SiPixelDigiSoA/test/BuildFile.xml b/DataFormats/SiPixelDigiSoA/test/BuildFile.xml index 48a107578a641..b4bd8297f5011 100644 --- a/DataFormats/SiPixelDigiSoA/test/BuildFile.xml +++ b/DataFormats/SiPixelDigiSoA/test/BuildFile.xml @@ -1,11 +1,11 @@ - + - + diff --git a/DataFormats/SiPixelDigiSoA/test/alpaka/DigiErrors_test.cc b/DataFormats/SiPixelDigiSoA/test/alpaka/DigiErrors_test.cc index 2f61b993884bd..4703e68630f35 100644 --- a/DataFormats/SiPixelDigiSoA/test/alpaka/DigiErrors_test.cc +++ b/DataFormats/SiPixelDigiSoA/test/alpaka/DigiErrors_test.cc @@ -4,7 +4,7 @@ #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsDevice.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsHost.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsSoA.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h" #include "HeterogeneousCore/AlpakaInterface/interface/devices.h" #include "HeterogeneousCore/AlpakaInterface/interface/host.h" @@ -31,7 +31,7 @@ int main() { { // Instantiate tracks on device. PortableDeviceCollection allocates // SoA on device automatically. - SiPixelDigiErrorsCollection digiErrors_d(1000, queue); + SiPixelDigiErrorsSoACollection digiErrors_d(1000, queue); testDigisSoA::runKernels(digiErrors_d.view(), queue); // Instantate tracks on host. This is where the data will be diff --git a/DataFormats/SiPixelDigiSoA/test/alpaka/DigiErrors_test.dev.cc b/DataFormats/SiPixelDigiSoA/test/alpaka/DigiErrors_test.dev.cc index 96825afe2a001..c7add92dab018 100644 --- a/DataFormats/SiPixelDigiSoA/test/alpaka/DigiErrors_test.dev.cc +++ b/DataFormats/SiPixelDigiSoA/test/alpaka/DigiErrors_test.dev.cc @@ -1,5 +1,5 @@ #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsHost.h" #include "DataFormats/SiPixelRawData/interface/SiPixelErrorCompact.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" diff --git a/DataFormats/SiPixelDigiSoA/test/alpaka/Digis_test.cc b/DataFormats/SiPixelDigiSoA/test/alpaka/Digis_test.cc index 61f5756adf213..f1d9ce9cd2b37 100644 --- a/DataFormats/SiPixelDigiSoA/test/alpaka/Digis_test.cc +++ b/DataFormats/SiPixelDigiSoA/test/alpaka/Digis_test.cc @@ -4,8 +4,8 @@ #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h" -#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "HeterogeneousCore/AlpakaInterface/interface/devices.h" #include "HeterogeneousCore/AlpakaInterface/interface/host.h" @@ -18,7 +18,7 @@ using namespace ALPAKA_ACCELERATOR_NAMESPACE; namespace ALPAKA_ACCELERATOR_NAMESPACE { namespace testDigisSoA { - void runKernels(SiPixelDigisSoAv2View digis_view, Queue& queue); + void runKernels(SiPixelDigisSoAView digis_view, Queue& queue); } } // namespace ALPAKA_ACCELERATOR_NAMESPACE @@ -32,7 +32,7 @@ int main() { { // Instantiate tracks on device. PortableDeviceCollection allocates // SoA on device automatically. - SiPixelDigisCollection digis_d(1000, queue); + SiPixelDigisSoACollection digis_d(1000, queue); testDigisSoA::runKernels(digis_d.view(), queue); // Instantate tracks on host. This is where the data will be diff --git a/DataFormats/SiPixelDigiSoA/test/alpaka/Digis_test.dev.cc b/DataFormats/SiPixelDigiSoA/test/alpaka/Digis_test.dev.cc index 97026b76f938f..9bb35bfc4d7f8 100644 --- a/DataFormats/SiPixelDigiSoA/test/alpaka/Digis_test.dev.cc +++ b/DataFormats/SiPixelDigiSoA/test/alpaka/Digis_test.dev.cc @@ -1,5 +1,5 @@ #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisHost.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "HeterogeneousCore/AlpakaInterface/interface/traits.h" @@ -14,7 +14,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { class TestFillKernel { public: template >> - ALPAKA_FN_ACC void operator()(TAcc const& acc, SiPixelDigisSoAv2View digi_view) const { + ALPAKA_FN_ACC void operator()(TAcc const& acc, SiPixelDigisSoAView digi_view) const { for (int32_t j : elements_with_stride(acc, digi_view.metadata().size())) { digi_view[j].clus() = j; digi_view[j].rawIdArr() = j * 2; @@ -27,7 +27,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { class TestVerifyKernel { public: template >> - ALPAKA_FN_ACC void operator()(TAcc const& acc, SiPixelDigisSoAv2ConstView digi_view) const { + ALPAKA_FN_ACC void operator()(TAcc const& acc, SiPixelDigisSoAConstView digi_view) const { for (uint32_t j : elements_with_stride(acc, digi_view.metadata().size())) { assert(digi_view[j].clus() == int(j)); assert(digi_view[j].rawIdArr() == j * 2); @@ -37,7 +37,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { } }; - void runKernels(SiPixelDigisSoAv2View digi_view, Queue& queue) { + void runKernels(SiPixelDigisSoAView digi_view, Queue& queue) { uint32_t items = 64; uint32_t groups = divide_up_by(digi_view.metadata().size(), items); auto workDiv = make_workdiv(groups, items); diff --git a/DataFormats/TrackSoA/README.md b/DataFormats/TrackSoA/README.md index fe31bd0acfa92..0dbaa1f2e5869 100644 --- a/DataFormats/TrackSoA/README.md +++ b/DataFormats/TrackSoA/README.md @@ -2,13 +2,12 @@ `DataFormat`s meant to be used on Host (CPU) or Device ( GPU) for storing information about `TrackSoA`s created during the Pixel-local Reconstruction -chain. It stores data in an SoA manner. It combines the data contained in the -deprecated `TrackSoAHeterogeneousT` and `TrajectoryStateSoAT` classes. +chain. It stores data in an SoA manner. The host format is inheriting from `DataFormats/Portable/interface/PortableHostCollection.h`, while the device format is inheriting from `DataFormats/Portable/interface/PortableDeviceCollection.h` -Both formats use the same SoA Layout (`TrackSoAHeterogeneousLayout`) which is generated +Both formats use the same SoA Layout (`TrackSoA::Layout`) which is generated via the `GENERATE_SOA_LAYOUT` macro in the `TrackDefinitions.h` file. ## Notes @@ -20,7 +19,7 @@ is replaced, but there don't seem to be any conflicts in including it in the `La - Host and Device classes should **not** be created via inheritance, as they're done here, but via composition. See [this discussion](https://github.com/cms-sw/cmssw/pull/40465#discussion_r1066039309). -## TrackSoAHost +## TracksHost The version of the data format to be used for storing `TrackSoA` data on the CPU. Instances of this class are to be used for: @@ -28,27 +27,27 @@ Instances of this class are to be used for: - Having a place to copy data to host from device, via `Memcpy`, or - Running host-side algorithms using data stored in an SoA manner. -## TrackSoADevice +## TracksDevice The version of the data format to be used for storing `TrackSoA` data on the GPU. -Instances of `TrackSoADevice` are to be created on host and be +Instances of `TracksDevice` are to be created on host and be used on device only. To do so, the instance's `view()` method is to be called to pass a `View` to any kernel launched. Accessing data from the `view()` is not possible on the host side. -## TrackSoACollection +## TracksSoACollection -Depending on the Alpaka accelerator back-end enabled, `TrackSoACollection` wraps either the Host or Device SoA: +Depending on the Alpaka accelerator back-end enabled, `TracksSoACollection` wraps either the Host or Device SoA: ```cpp #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED template - using TrackSoACollection = TrackSoAHost; + using TracksSoACollection = TracksHost; #else template - using TrackSoACollection = TrackSoADevice; + using TracksSoACollection = TracksDevice; #endif ``` diff --git a/DataFormats/TrackSoA/interface/TrackSoADevice.h b/DataFormats/TrackSoA/interface/TracksDevice.h similarity index 66% rename from DataFormats/TrackSoA/interface/TrackSoADevice.h rename to DataFormats/TrackSoA/interface/TracksDevice.h index f2e66a4c95e1d..2bd86c060986e 100644 --- a/DataFormats/TrackSoA/interface/TrackSoADevice.h +++ b/DataFormats/TrackSoA/interface/TracksDevice.h @@ -1,10 +1,10 @@ -#ifndef DataFormats_Track_interface_TrackSoADevice_h -#define DataFormats_Track_interface_TrackSoADevice_h +#ifndef DataFormats_Track_interface_TracksDevice_h +#define DataFormats_Track_interface_TracksDevice_h #include #include #include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "DataFormats/TrackSoA/interface/TrackLayout.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" #include "DataFormats/TrackSoA/interface/TrackDefinitions.h" #include "DataFormats/Portable/interface/PortableDeviceCollection.h" #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" @@ -13,10 +13,10 @@ // This is generally discouraged, and should be done via composition. // See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306 template -class TrackSoADevice : public PortableDeviceCollection, TDev> { +class TracksDevice : public PortableDeviceCollection, TDev> { public: static constexpr int32_t S = TrackerTraits::maxNumberOfTuples; //TODO: this could be made configurable at runtime - TrackSoADevice() = default; // necessary for ROOT dictionaries + TracksDevice() = default; // necessary for ROOT dictionaries using PortableDeviceCollection, TDev>::view; using PortableDeviceCollection, TDev>::const_view; @@ -24,17 +24,17 @@ class TrackSoADevice : public PortableDeviceCollection - explicit TrackSoADevice(TQueue queue) + explicit TracksDevice(TQueue queue) : PortableDeviceCollection, TDev>(S, queue) {} }; namespace pixelTrack { template - using TrackSoADevicePhase1 = TrackSoADevice; + using TracksDevicePhase1 = TracksDevice; template - using TrackSoADevicePhase2 = TrackSoADevice; + using TracksDevicePhase2 = TracksDevice; } // namespace pixelTrack -#endif // DataFormats_Track_TrackSoADevice_H +#endif // DataFormats_Track_TracksDevice_H diff --git a/DataFormats/TrackSoA/interface/TrackSoAHost.h b/DataFormats/TrackSoA/interface/TracksHost.h similarity index 60% rename from DataFormats/TrackSoA/interface/TrackSoAHost.h rename to DataFormats/TrackSoA/interface/TracksHost.h index 660334997caaa..87202a3923703 100644 --- a/DataFormats/TrackSoA/interface/TrackSoAHost.h +++ b/DataFormats/TrackSoA/interface/TracksHost.h @@ -1,11 +1,11 @@ -#ifndef DataFormats_Track_TrackSoAHost_H -#define DataFormats_Track_TrackSoAHost_H +#ifndef DataFormats_Track_TracksHost_H +#define DataFormats_Track_TracksHost_H #include #include #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "DataFormats/TrackSoA/interface/TrackLayout.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" #include "DataFormats/TrackSoA/interface/TrackDefinitions.h" #include "DataFormats/Portable/interface/PortableHostCollection.h" @@ -13,10 +13,10 @@ // This is generally discouraged, and should be done via composition. // See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306 template -class TrackSoAHost : public PortableHostCollection> { +class TracksHost : public PortableHostCollection> { public: static constexpr int32_t S = TrackerTraits::maxNumberOfTuples; //TODO: this could be made configurable at runtime - TrackSoAHost() = default; // Needed for the dictionary; not sure if line above is needed anymore + TracksHost() = default; // Needed for the dictionary; not sure if line above is needed anymore using PortableHostCollection>::view; using PortableHostCollection>::const_view; @@ -24,19 +24,19 @@ class TrackSoAHost : public PortableHostCollection> { // Constructor which specifies the SoA size template - explicit TrackSoAHost(TQueue queue) : PortableHostCollection>(S, queue) {} + explicit TracksHost(TQueue queue) : PortableHostCollection>(S, queue) {} // Constructor which specifies the DevHost - explicit TrackSoAHost(alpaka_common::DevHost const& host) + explicit TracksHost(alpaka_common::DevHost const& host) : PortableHostCollection>(S, host) {} }; namespace pixelTrack { - using TrackSoAHostPhase1 = TrackSoAHost; - using TrackSoAHostPhase2 = TrackSoAHost; - using TrackSoAHostHIonPhase1 = TrackSoAHost; + using TracksHostPhase1 = TracksHost; + using TracksHostPhase2 = TracksHost; + using TracksHostHIonPhase1 = TracksHost; } // namespace pixelTrack -#endif // DataFormats_Track_TrackSoAHost_H +#endif // DataFormats_Track_TracksHost_H diff --git a/DataFormats/TrackSoA/interface/TrackLayout.h b/DataFormats/TrackSoA/interface/TracksSoA.h similarity index 75% rename from DataFormats/TrackSoA/interface/TrackLayout.h rename to DataFormats/TrackSoA/interface/TracksSoA.h index 7458472f612da..3bb2c2f153c58 100644 --- a/DataFormats/TrackSoA/interface/TrackLayout.h +++ b/DataFormats/TrackSoA/interface/TracksSoA.h @@ -21,7 +21,7 @@ struct TrackSoA { using HitContainer = cms::alpakatools::OneToManyAssocSequential; - GENERATE_SOA_LAYOUT(TrackSoAHeterogeneousLayout, + GENERATE_SOA_LAYOUT(Layout, SOA_COLUMN(Quality, quality), SOA_COLUMN(float, chi2), SOA_COLUMN(int8_t, nLayers), @@ -35,18 +35,10 @@ struct TrackSoA { }; template -using TrackLayout = typename TrackSoA::template TrackSoAHeterogeneousLayout<>; +using TrackLayout = typename TrackSoA::template Layout<>; template -using TrackSoAView = typename TrackSoA::template TrackSoAHeterogeneousLayout<>::View; +using TrackSoAView = typename TrackSoA::template Layout<>::View; template -using TrackSoAConstView = typename TrackSoA::template TrackSoAHeterogeneousLayout<>::ConstView; - -// State at the Beam spot -// phi,tip,1/pt,cotan(theta),zip -// template -// ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE constexpr float charge(const TrackSoAConstView& tracks, int32_t i) { -// float v = tracks[i].state()(2); -// return float((0.0f < v) - (v < 0.0f)); -// } +using TrackSoAConstView = typename TrackSoA::template Layout<>::ConstView; #endif diff --git a/DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h b/DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h deleted file mode 100644 index 19d1fd1af2188..0000000000000 --- a/DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef DataFormats_Track_interface_alpaka_TrackSoACollection_h -#define DataFormats_Track_interface_alpaka_TrackSoACollection_h - -#include -#include -#include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "DataFormats/TrackSoA/interface/TrackLayout.h" -#include "DataFormats/TrackSoA/interface/TrackDefinitions.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" -#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" -#include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" - -// TODO: The class is created via inheritance of the PortableCollection. -// This is generally discouraged, and should be done via composition. -// See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306 -namespace ALPAKA_ACCELERATOR_NAMESPACE { -#ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED - template - using TrackSoACollection = TrackSoAHost; -#else - template - using TrackSoACollection = TrackSoADevice; -#endif - //Classes definition for Phase1/Phase2/HIonPhase1, to make the classes_def lighter. Not actually used in the code. - namespace pixelTrack { - using TrackSoACollectionPhase1 = TrackSoACollection; - using TrackSoACollectionPhase2 = TrackSoACollection; - using TrackSoACollectionHIonPhase1 = TrackSoACollection; - } // namespace pixelTrack -} // namespace ALPAKA_ACCELERATOR_NAMESPACE - -namespace cms::alpakatools { - template - struct CopyToHost> { - template - static auto copyAsync(TQueue& queue, - ALPAKA_ACCELERATOR_NAMESPACE::TrackSoACollection const& deviceData) { - ::TrackSoAHost hostData(queue); - alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer()); - return hostData; - } - }; -} // namespace cms::alpakatools - -#endif // DataFormats_Track_interface_alpaka_TrackSoACollection_h diff --git a/DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h b/DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h index 5751f7857dbe5..16318cde224c7 100644 --- a/DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h +++ b/DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h @@ -3,13 +3,13 @@ #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "DataFormats/TrackSoA/interface/TrackDefinitions.h" -#include "DataFormats/TrackSoA/interface/TrackLayout.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" // Methods that operate on View and ConstView of the TrackSoA, and cannot be class methods. template struct TracksUtilities { - using TrackSoAView = typename TrackSoA::template TrackSoAHeterogeneousLayout<>::View; - using TrackSoAConstView = typename TrackSoA::template TrackSoAHeterogeneousLayout<>::ConstView; + using TrackSoAView = typename TrackSoA::template Layout<>::View; + using TrackSoAConstView = typename TrackSoA::template Layout<>::ConstView; using hindex_type = typename TrackSoA::hindex_type; // State at the Beam spot @@ -107,8 +107,8 @@ namespace pixelTrack { template struct QualityCutsT> { - using TrackSoAView = typename TrackSoA::template TrackSoAHeterogeneousLayout<>::View; - using TrackSoAConstView = typename TrackSoA::template TrackSoAHeterogeneousLayout<>::ConstView; + using TrackSoAView = typename TrackSoA::template Layout<>::View; + using TrackSoAConstView = typename TrackSoA::template Layout<>::ConstView; using tracksHelper = TracksUtilities; float chi2Coeff[4]; float chi2MaxPt; // GeV @@ -170,8 +170,8 @@ namespace pixelTrack { template struct QualityCutsT> { - using TrackSoAView = typename TrackSoA::template TrackSoAHeterogeneousLayout<>::View; - using TrackSoAConstView = typename TrackSoA::template TrackSoAHeterogeneousLayout<>::ConstView; + using TrackSoAView = typename TrackSoA::template Layout<>::View; + using TrackSoAConstView = typename TrackSoA::template Layout<>::ConstView; using tracksHelper = TracksUtilities; float maxChi2; diff --git a/DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h b/DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h new file mode 100644 index 0000000000000..1ff964b6e0fb6 --- /dev/null +++ b/DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h @@ -0,0 +1,52 @@ +#ifndef DataFormats_Track_interface_alpaka_TracksSoACollection_h +#define DataFormats_Track_interface_alpaka_TracksSoACollection_h + +#include +#include +#include "HeterogeneousCore/AlpakaInterface/interface/config.h" +#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" +#include "DataFormats/TrackSoA/interface/TrackDefinitions.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" +#include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" + +// TODO: The class is created via inheritance of the PortableCollection. +// This is generally discouraged, and should be done via composition. +// See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306 + +namespace ALPAKA_ACCELERATOR_NAMESPACE { + + template + using TracksSoACollection = + std::conditional_t, TracksHost, TracksDevice>; + + //Classes definition for Phase1/Phase2/HIonPhase1, to make the classes_def lighter. Not actually used in the code. + namespace pixelTrack { + using TracksSoACollectionPhase1 = TracksSoACollection; + using TracksSoACollectionPhase2 = TracksSoACollection; + using TracksSoACollectionHIonPhase1 = TracksSoACollection; + } // namespace pixelTrack +} // namespace ALPAKA_ACCELERATOR_NAMESPACE + +namespace cms::alpakatools { + template + struct CopyToHost> { + template + static auto copyAsync(TQueue& queue, + TracksDevice const& deviceData) { + ::TracksHost hostData(queue); + alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer()); + #ifdef GPU_DEBUG + printf("TracksSoACollection: I'm copying to host.\n"); + #endif + return hostData; + } + }; +} // namespace cms::alpakatools + +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(pixelTrack::TracksSoACollectionPhase1, pixelTrack::TracksHostPhase1); +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(pixelTrack::TracksSoACollectionPhase2, pixelTrack::TracksHostPhase2); +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(pixelTrack::TracksSoACollectionHIonPhase1, pixelTrack::TracksHostHIonPhase1); + +#endif // DataFormats_Track_interface_alpaka_TracksSoACollection_h diff --git a/DataFormats/TrackSoA/src/alpaka/classes_cuda.h b/DataFormats/TrackSoA/src/alpaka/classes_cuda.h index 0212d576ec101..900118b3f9b44 100644 --- a/DataFormats/TrackSoA/src/alpaka/classes_cuda.h +++ b/DataFormats/TrackSoA/src/alpaka/classes_cuda.h @@ -4,9 +4,9 @@ #include "DataFormats/Common/interface/DeviceProduct.h" #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/TrackSoA/interface/TrackLayout.h" -#include "DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" +#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" using namespace pixelTopology; diff --git a/DataFormats/TrackSoA/src/alpaka/classes_cuda_def.xml b/DataFormats/TrackSoA/src/alpaka/classes_cuda_def.xml index 1406d55e4bd6e..c04ca173c49f9 100644 --- a/DataFormats/TrackSoA/src/alpaka/classes_cuda_def.xml +++ b/DataFormats/TrackSoA/src/alpaka/classes_cuda_def.xml @@ -1,10 +1,10 @@ - - - + + + - - - + + + diff --git a/DataFormats/TrackSoA/src/alpaka/classes_rocm.h b/DataFormats/TrackSoA/src/alpaka/classes_rocm.h index 0f59bb8fff16a..842c02b9c4721 100644 --- a/DataFormats/TrackSoA/src/alpaka/classes_rocm.h +++ b/DataFormats/TrackSoA/src/alpaka/classes_rocm.h @@ -4,9 +4,9 @@ #include "DataFormats/Common/interface/DeviceProduct.h" #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/TrackSoA/interface/TrackLayout.h" -#include "DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" +#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" using namespace pixelTopology; diff --git a/DataFormats/TrackSoA/src/alpaka/classes_rocm_def.xml b/DataFormats/TrackSoA/src/alpaka/classes_rocm_def.xml index 8ccf1f761a745..b7e40aedead42 100644 --- a/DataFormats/TrackSoA/src/alpaka/classes_rocm_def.xml +++ b/DataFormats/TrackSoA/src/alpaka/classes_rocm_def.xml @@ -1,10 +1,10 @@ - - - + + + - - - + + + diff --git a/DataFormats/TrackSoA/src/classes.cc b/DataFormats/TrackSoA/src/classes.cc new file mode 100644 index 0000000000000..4c77402d2057f --- /dev/null +++ b/DataFormats/TrackSoA/src/classes.cc @@ -0,0 +1,7 @@ +#include "DataFormats/Portable/interface/PortableHostCollectionReadRules.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" +#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" + +SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection>); +SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection>); +// SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection>); \ No newline at end of file diff --git a/DataFormats/TrackSoA/src/classes.h b/DataFormats/TrackSoA/src/classes.h index c12ec31890edb..dc95c91608c80 100644 --- a/DataFormats/TrackSoA/src/classes.h +++ b/DataFormats/TrackSoA/src/classes.h @@ -2,8 +2,8 @@ #define DataFormats_Track_src_classes_h #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/TrackSoA/interface/TrackLayout.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" using namespace pixelTopology; using namespace pixelTrack; diff --git a/DataFormats/TrackSoA/src/classes_def.xml b/DataFormats/TrackSoA/src/classes_def.xml index 592458cb82c3d..000f3c3185069 100644 --- a/DataFormats/TrackSoA/src/classes_def.xml +++ b/DataFormats/TrackSoA/src/classes_def.xml @@ -1,63 +1,28 @@ - + - + - + - - - >::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - - - + + + - - >::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - - - - - - - >::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - - - + + + + diff --git a/DataFormats/TrackSoA/test/alpaka/TrackSoAHeterogeneous_test.cc b/DataFormats/TrackSoA/test/alpaka/TrackSoAHeterogeneous_test.cc index 8b7565200c52d..93503a3c70b39 100644 --- a/DataFormats/TrackSoA/test/alpaka/TrackSoAHeterogeneous_test.cc +++ b/DataFormats/TrackSoA/test/alpaka/TrackSoAHeterogeneous_test.cc @@ -15,9 +15,9 @@ #include #include -#include "DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" +#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" #include "HeterogeneousCore/AlpakaInterface/interface/devices.h" #include "HeterogeneousCore/AlpakaInterface/interface/host.h" #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" @@ -46,12 +46,12 @@ int main() { { // Instantiate tracks on device. PortableDeviceCollection allocates // SoA on device automatically. - TrackSoACollection tracks_d(queue); + TracksSoACollection tracks_d(queue); testTrackSoA::runKernels(tracks_d.view(), queue); // Instantate tracks on host. This is where the data will be // copied to from device. - TrackSoAHost tracks_h(queue); + TracksHost tracks_h(queue); std::cout << tracks_h.view().metadata().size() << std::endl; alpaka::memcpy(queue, tracks_h.buffer(), tracks_d.const_buffer()); diff --git a/DataFormats/TrackSoA/test/alpaka/TrackSoAHeterogeneous_test.dev.cc b/DataFormats/TrackSoA/test/alpaka/TrackSoAHeterogeneous_test.dev.cc index dcecbcabde26e..0436bf9ab4e8f 100644 --- a/DataFormats/TrackSoA/test/alpaka/TrackSoAHeterogeneous_test.dev.cc +++ b/DataFormats/TrackSoA/test/alpaka/TrackSoAHeterogeneous_test.dev.cc @@ -1,8 +1,8 @@ #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "DataFormats/TrackSoA/interface/TrackDefinitions.h" -#include "DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" +#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" using Quality = pixelTrack::Quality; namespace ALPAKA_ACCELERATOR_NAMESPACE { diff --git a/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h b/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h similarity index 70% rename from DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h rename to DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h index 451d0a4a54054..fde8c8d70888e 100644 --- a/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h +++ b/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h @@ -1,30 +1,30 @@ -#ifndef DataFormats_RecHits_interface_TrackingRecHitSoADevice_h -#define DataFormats_RecHits_interface_TrackingRecHitSoADevice_h +#ifndef DataFormats_TrackingRecHitSoA_interface_TrackingRecHitSoADevice_h +#define DataFormats_TrackingRecHitSoA_interface_TrackingRecHitSoADevice_h #include #include #include "DataFormats/Portable/interface/PortableDeviceCollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" template -class TrackingRecHitDevice : public PortableDeviceCollection, TDev> { +class TrackingRecHitDevice : public PortableDeviceCollection, TDev> { public: - using hitSoA = TrackingRecHitAlpakaSoA; + using hitSoA = TrackingRecHitSoA; //Need to decorate the class with the inherited portable accessors being now a template - using PortableDeviceCollection, TDev>::view; - using PortableDeviceCollection, TDev>::const_view; - using PortableDeviceCollection, TDev>::buffer; + using PortableDeviceCollection, TDev>::view; + using PortableDeviceCollection, TDev>::const_view; + using PortableDeviceCollection, TDev>::buffer; TrackingRecHitDevice() = default; // Constructor which specifies the SoA size template explicit TrackingRecHitDevice(uint32_t nHits, int32_t offsetBPIX2, uint32_t const* hitsModuleStart, TQueue queue) - : PortableDeviceCollection, TDev>(nHits, queue) { + : PortableDeviceCollection, TDev>(nHits, queue) { const auto device = alpaka::getDev(queue); auto start_h = cms::alpakatools::make_host_view(hitsModuleStart, TrackerTraits::numberOfModules + 1); diff --git a/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h b/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h similarity index 73% rename from DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h rename to DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h index f5acf376d1fdd..ce3f57232ac93 100644 --- a/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h +++ b/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h @@ -6,28 +6,28 @@ #include #include "DataFormats/Portable/interface/PortableHostCollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" template -class TrackingRecHitHost : public PortableHostCollection> { +class TrackingRecHitHost : public PortableHostCollection> { public: - using hitSoA = TrackingRecHitAlpakaSoA; + using hitSoA = TrackingRecHitSoA; //Need to decorate the class with the inherited portable accessors being now a template - using PortableHostCollection>::view; - using PortableHostCollection>::const_view; - using PortableHostCollection>::buffer; + using PortableHostCollection>::view; + using PortableHostCollection>::const_view; + using PortableHostCollection>::buffer; TrackingRecHitHost() = default; template explicit TrackingRecHitHost(uint32_t nHits, TQueue queue) - : PortableHostCollection>(nHits, queue) {} + : PortableHostCollection>(nHits, queue) {} // Constructor which specifies the SoA size template explicit TrackingRecHitHost(uint32_t nHits, int32_t offsetBPIX2, uint32_t const* hitsModuleStart, TQueue queue) - : PortableHostCollection>(nHits, queue) { + : PortableHostCollection>(nHits, queue) { std::copy(hitsModuleStart, hitsModuleStart + TrackerTraits::numberOfModules + 1, view().hitsModuleStart().data()); view().offsetBPIX2() = offsetBPIX2; } diff --git a/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h b/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h similarity index 73% rename from DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h rename to DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h index 9f22feb60e836..913ce0116aa65 100644 --- a/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h +++ b/DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h @@ -1,29 +1,28 @@ -#ifndef DataFormats_RecHits_TrackingRecHitsLayout_h -#define DataFormats_RecHits_TrackingRecHitsLayout_h +#ifndef DataFormats_TrackingRecHitSoA_interface_TrackingRecHitsSoA_h +#define DataFormats_TrackingRecHitSoA_interface_TrackingRecHitsSoA_h #include #include "DataFormats/SoATemplate/interface/SoALayout.h" #include "DataFormats/TrackingRecHitSoA/interface/SiPixelHitStatus.h" -#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "HeterogeneousCore/AlpakaInterface/interface/HistoContainer.h" #include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h" template -struct TrackingRecHitAlpakaSoA { +struct TrackingRecHitSoA { using hindex_type = typename TrackerTraits::hindex_type; using PhiBinner = cms::alpakatools::HistoContainer; //28 for phase2 geometry + using PhiBinnerView = typename PhiBinner::View; using PhiBinnerStorageType = typename PhiBinner::index_type; using AverageGeometry = pixelTopology::AverageGeometryT; using HitLayerStartArray = std::array; using HitModuleStartArray = std::array; - //Is it better to have two split? GENERATE_SOA_LAYOUT(Layout, SOA_COLUMN(float, xLocal), SOA_COLUMN(float, yLocal), @@ -39,9 +38,6 @@ struct TrackingRecHitAlpakaSoA { SOA_COLUMN(int16_t, clusterSizeY), SOA_COLUMN(uint16_t, detectorIndex), SOA_SCALAR(int32_t, offsetBPIX2), - //These above could be separated in a specific - //layout since they don't depends on the template - //for the moment I'm keeping them here SOA_COLUMN(PhiBinnerStorageType, phiBinnerStorage), SOA_SCALAR(HitModuleStartArray, hitsModuleStart), SOA_SCALAR(HitLayerStartArray, hitsLayerStart), @@ -50,10 +46,10 @@ struct TrackingRecHitAlpakaSoA { }; template -using TrackingRecHitAlpakaLayout = typename TrackingRecHitAlpakaSoA::template Layout<>; +using TrackingRecHitLayout = typename TrackingRecHitSoA::template Layout<>; template -using TrackingRecHitAlpakaSoAView = typename TrackingRecHitAlpakaSoA::template Layout<>::View; +using TrackingRecHitSoAView = typename TrackingRecHitSoA::template Layout<>::View; template -using TrackingRecHitAlpakaSoAConstView = typename TrackingRecHitAlpakaSoA::template Layout<>::ConstView; +using TrackingRecHitSoAConstView = typename TrackingRecHitSoA::template Layout<>::ConstView; #endif diff --git a/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h b/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h deleted file mode 100644 index f05f268ae8892..0000000000000 --- a/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef DataFormats_RecHits_interface_alpaka_TrackingRecHitSoACollection_h -#define DataFormats_RecHits_interface_alpaka_TrackingRecHitSoACollection_h - -#include -#include -#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h" -#include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" - -namespace ALPAKA_ACCELERATOR_NAMESPACE { -#ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED - template - using TrackingRecHitAlpakaCollection = TrackingRecHitHost; -#else - template - using TrackingRecHitAlpakaCollection = TrackingRecHitDevice; -#endif - //Classes definition for Phase1/Phase2, to make the classes_def lighter. Not actually used in the code. - using TrackingRecHitAlpakaSoAPhase1 = TrackingRecHitAlpakaCollection; - using TrackingRecHitAlpakaSoAPhase2 = TrackingRecHitAlpakaCollection; - using TrackingRecHitAlpakaSoAHIonPhase1 = TrackingRecHitAlpakaCollection; - -} // namespace ALPAKA_ACCELERATOR_NAMESPACE - -namespace cms::alpakatools { - template - struct CopyToHost> { - template - static auto copyAsync( - TQueue& queue, ALPAKA_ACCELERATOR_NAMESPACE::TrackingRecHitAlpakaCollection const& deviceData) { - TrackingRecHitHost hostData(deviceData.view().metadata().size(), queue); - alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer()); - return hostData; - } - }; -} // namespace cms::alpakatools - -#endif // DataFormats_RecHits_interface_alpaka_TrackingRecHitSoACollection_h \ No newline at end of file diff --git a/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h b/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h new file mode 100644 index 0000000000000..ea180b3180ddb --- /dev/null +++ b/DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h @@ -0,0 +1,46 @@ +#ifndef DataFormats_RecHits_interface_alpakaTrackingRecHitsSoACollection +#define DataFormats_RecHits_interface_alpakaTrackingRecHitsSoACollection + +#include +#include +#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h" +#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" +#include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" + +namespace ALPAKA_ACCELERATOR_NAMESPACE { + + template + using TrackingRecHitsSoACollection = + std::conditional_t, TrackingRecHitHost, TrackingRecHitDevice>; + + //Classes definition for Phase1/Phase2, to make the classes_def lighter. Not actually used in the code. + using TrackingRecHitSoAPhase1 = TrackingRecHitsSoACollection; + using TrackingRecHitSoAPhase2 = TrackingRecHitsSoACollection; + using TrackingRecHitSoAHIonPhase1 = TrackingRecHitsSoACollection; + +} // namespace ALPAKA_ACCELERATOR_NAMESPACE + +namespace cms::alpakatools { + template + struct CopyToHost> { + template + static auto copyAsync( + TQueue& queue, TrackingRecHitDevice const& deviceData) { + TrackingRecHitHost hostData(deviceData.view().metadata().size(), queue); + alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer()); + #ifdef GPU_DEBUG + printf("TrackingRecHitsSoACollection: I'm copying to host.\n"); + #endif + return hostData; + } + }; +} // namespace cms::alpakatools + +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(TrackingRecHitSoAPhase1, TrackingRecHitHostPhase1); +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(TrackingRecHitSoAPhase2, TrackingRecHitHostPhase2); +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(TrackingRecHitSoAHIonPhase1, TrackingRecHitHostHIonPhase1); + +#endif // DataFormats_RecHits_interface_alpakaTrackingRecHitsSoACollection \ No newline at end of file diff --git a/DataFormats/TrackingRecHitSoA/src/alpaka/classes_cuda.h b/DataFormats/TrackingRecHitSoA/src/alpaka/classes_cuda.h index 5626fb582225e..091011e74d74e 100644 --- a/DataFormats/TrackingRecHitSoA/src/alpaka/classes_cuda.h +++ b/DataFormats/TrackingRecHitSoA/src/alpaka/classes_cuda.h @@ -3,9 +3,9 @@ #include "DataFormats/Common/interface/DeviceProduct.h" #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" -#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" using namespace pixelTopology; diff --git a/DataFormats/TrackingRecHitSoA/src/alpaka/classes_cuda_def.xml b/DataFormats/TrackingRecHitSoA/src/alpaka/classes_cuda_def.xml index ae76e081f4cb0..bc8edda91bb85 100644 --- a/DataFormats/TrackingRecHitSoA/src/alpaka/classes_cuda_def.xml +++ b/DataFormats/TrackingRecHitSoA/src/alpaka/classes_cuda_def.xml @@ -1,10 +1,10 @@ - - - - - - - - + + + + + + + + diff --git a/DataFormats/TrackingRecHitSoA/src/alpaka/classes_rocm.h b/DataFormats/TrackingRecHitSoA/src/alpaka/classes_rocm.h index 3c772b2f1eba0..73360cc16473e 100644 --- a/DataFormats/TrackingRecHitSoA/src/alpaka/classes_rocm.h +++ b/DataFormats/TrackingRecHitSoA/src/alpaka/classes_rocm.h @@ -3,8 +3,8 @@ #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/DeviceProduct.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" -#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h" #endif // DataFormats_Track_src_alpaka_classes_rocm_h \ No newline at end of file diff --git a/DataFormats/TrackingRecHitSoA/src/alpaka/classes_rocm_def.xml b/DataFormats/TrackingRecHitSoA/src/alpaka/classes_rocm_def.xml index afa188cca6c2c..a2847b26c0714 100644 --- a/DataFormats/TrackingRecHitSoA/src/alpaka/classes_rocm_def.xml +++ b/DataFormats/TrackingRecHitSoA/src/alpaka/classes_rocm_def.xml @@ -1,11 +1,11 @@ - - - - - - - - + + + + + + + + diff --git a/DataFormats/TrackingRecHitSoA/src/classes.cc b/DataFormats/TrackingRecHitSoA/src/classes.cc new file mode 100644 index 0000000000000..58167c21cef4f --- /dev/null +++ b/DataFormats/TrackingRecHitSoA/src/classes.cc @@ -0,0 +1,7 @@ +#include "DataFormats/Portable/interface/PortableHostCollectionReadRules.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" +#include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" + +SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection>); +SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection>); +SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection>); \ No newline at end of file diff --git a/DataFormats/TrackingRecHitSoA/src/classes.h b/DataFormats/TrackingRecHitSoA/src/classes.h index dcc412e32effc..8aa9157952e30 100644 --- a/DataFormats/TrackingRecHitSoA/src/classes.h +++ b/DataFormats/TrackingRecHitSoA/src/classes.h @@ -3,8 +3,8 @@ #include "DataFormats/Common/interface/Wrapper.h" #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h" using namespace pixelTopology; diff --git a/DataFormats/TrackingRecHitSoA/src/classes_def.xml b/DataFormats/TrackingRecHitSoA/src/classes_def.xml index 78d14230a1062..daae47aa18c6d 100644 --- a/DataFormats/TrackingRecHitSoA/src/classes_def.xml +++ b/DataFormats/TrackingRecHitSoA/src/classes_def.xml @@ -1,61 +1,28 @@ - - - - + + + + - - - - + + + + - - - - + + + + - - - >::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - + - - - >::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - + - - - >::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - + diff --git a/DataFormats/TrackingRecHitSoA/test/alpaka/Hits_test.cc b/DataFormats/TrackingRecHitSoA/test/alpaka/Hits_test.cc index 88942a516f7ce..378bb95db7b30 100644 --- a/DataFormats/TrackingRecHitSoA/test/alpaka/Hits_test.cc +++ b/DataFormats/TrackingRecHitSoA/test/alpaka/Hits_test.cc @@ -1,6 +1,6 @@ -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h" -#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" #include "HeterogeneousCore/AlpakaInterface/interface/devices.h" #include "HeterogeneousCore/AlpakaInterface/interface/host.h" @@ -19,7 +19,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { namespace testTrackingRecHitSoA { template - void runKernels(TrackingRecHitAlpakaSoAView& hits, Queue& queue); + void runKernels(TrackingRecHitSoAView& hits, Queue& queue); } } // namespace ALPAKA_ACCELERATOR_NAMESPACE @@ -38,7 +38,7 @@ int main() { for (size_t i = 0; i < pixelTopology::Phase1::numberOfModules + 1; i++) { moduleStart[i] = i * 2; } - TrackingRecHitAlpakaCollection tkhit(nHits, offset, &moduleStart[0], queue); + TrackingRecHitsSoACollection tkhit(nHits, offset, &moduleStart[0], queue); testTrackingRecHitSoA::runKernels(tkhit.view(), queue); alpaka::wait(queue); diff --git a/DataFormats/TrackingRecHitSoA/test/alpaka/Hits_test.dev.cc b/DataFormats/TrackingRecHitSoA/test/alpaka/Hits_test.dev.cc index 2ef69aa101a09..a8238e07ce0a0 100644 --- a/DataFormats/TrackingRecHitSoA/test/alpaka/Hits_test.dev.cc +++ b/DataFormats/TrackingRecHitSoA/test/alpaka/Hits_test.dev.cc @@ -1,6 +1,6 @@ -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h" -#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "HeterogeneousCore/AlpakaInterface/interface/traits.h" @@ -15,7 +15,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { class TestFillKernel { public: template >> - ALPAKA_FN_ACC void operator()(TAcc const& acc, TrackingRecHitAlpakaSoAView soa) const { + ALPAKA_FN_ACC void operator()(TAcc const& acc, TrackingRecHitSoAView soa) const { const uint32_t i(alpaka::getIdx(acc)[0u]); const uint32_t j(alpaka::getIdx(acc)[0u]); @@ -33,7 +33,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { class ShowKernel { public: template >> - ALPAKA_FN_ACC void operator()(TAcc const& acc, TrackingRecHitAlpakaSoAConstView soa) const { + ALPAKA_FN_ACC void operator()(TAcc const& acc, TrackingRecHitSoAConstView soa) const { const uint32_t i(alpaka::getIdx(acc)[0u]); const uint32_t j(alpaka::getIdx(acc)[0u]); @@ -50,7 +50,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { }; template - void runKernels(TrackingRecHitAlpakaSoAView& view, Queue& queue) { + void runKernels(TrackingRecHitSoAView& view, Queue& queue) { uint32_t items = 64; uint32_t groups = divide_up_by(view.metadata().size(), items); auto workDiv = make_workdiv(groups, items); @@ -58,9 +58,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { alpaka::exec(queue, workDiv, ShowKernel{}, view); } - template void runKernels(TrackingRecHitAlpakaSoAView& view, + template void runKernels(TrackingRecHitSoAView& view, Queue& queue); - template void runKernels(TrackingRecHitAlpakaSoAView& view, + template void runKernels(TrackingRecHitSoAView& view, Queue& queue); } // namespace testTrackingRecHitSoA diff --git a/DataFormats/Vertex/interface/ZVertexSoADevice.h b/DataFormats/Vertex/interface/ZVertexSoADevice.h deleted file mode 100644 index 600f0edc7ca42..0000000000000 --- a/DataFormats/Vertex/interface/ZVertexSoADevice.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef DataFormats_Vertex_interface_ZVertexSoADevice_h -#define DataFormats_Vertex_interface_ZVertexSoADevice_h - -#include - -#include -#include "DataFormats/Vertex/interface/ZVertexLayout.h" -#include "DataFormats/Vertex/interface/ZVertexDefinitions.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" -#include "DataFormats/Portable/interface/PortableDeviceCollection.h" -#include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" - -template -class ZVertexSoADevice : public PortableDeviceCollection, TDev> { -public: - ZVertexSoADevice() = default; // necessary for ROOT dictionaries - - // Constructor which specifies the SoA size - template - explicit ZVertexSoADevice(TQueue queue) : PortableDeviceCollection, TDev>(S, queue) {} -}; - -using namespace ::zVertex; -template -using ZVertexDevice = ZVertexSoADevice; - -#endif // DataFormats_Vertex_interface_ZVertexSoADevice_h diff --git a/DataFormats/Vertex/interface/ZVertexSoAHost.h b/DataFormats/Vertex/interface/ZVertexSoAHost.h deleted file mode 100644 index 49c863a0da4fb..0000000000000 --- a/DataFormats/Vertex/interface/ZVertexSoAHost.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef DataFormats_Vertex_ZVertexSoAHost_H -#define DataFormats_Vertex_ZVertexSoAHost_H - -#include - -#include -#include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "DataFormats/Vertex/interface/ZVertexLayout.h" -#include "DataFormats/Vertex/interface/ZVertexDefinitions.h" -#include "DataFormats/Portable/interface/PortableHostCollection.h" - -template -class ZVertexSoAHost : public PortableHostCollection> { -public: - ZVertexSoAHost() = default; - - // Constructor which specifies the queue - template - explicit ZVertexSoAHost(TQueue queue) : PortableHostCollection>(S, queue) {} - - // Constructor which specifies the DevHost - explicit ZVertexSoAHost(alpaka_common::DevHost const& host) - : PortableHostCollection>(S, host) {} -}; - -using namespace ::zVertex; -using ZVertexHost = ZVertexSoAHost; - -#endif // DataFormats_Vertex_ZVertexSoAHost_H diff --git a/DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h b/DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h deleted file mode 100644 index 76e09e5e75e8f..0000000000000 --- a/DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef DataFormats_Vertex_interface_ZVertexSoACollection_h -#define DataFormats_Vertex_interface_ZVertexSoACollection_h - -#include - -#include -#include "DataFormats/Vertex/interface/ZVertexLayout.h" -#include "DataFormats/Vertex/interface/ZVertexDefinitions.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" -#include "DataFormats/Vertex/interface/ZVertexSoADevice.h" -#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" -#include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" - -namespace ALPAKA_ACCELERATOR_NAMESPACE { -#ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED - using ZVertexCollection = ZVertexHost; -#else - using ZVertexCollection = ZVertexDevice; -#endif -} // namespace ALPAKA_ACCELERATOR_NAMESPACE - -namespace cms::alpakatools { - template <> - struct CopyToHost { - template - static auto copyAsync(TQueue& queue, ALPAKA_ACCELERATOR_NAMESPACE::ZVertexCollection const& deviceData) { - ZVertexHost hostData(queue); - alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer()); - return hostData; - } - }; -} // namespace cms::alpakatools - -#endif // DataFormats_Vertex_interface_ZVertexSoACollection_h diff --git a/DataFormats/Vertex/src/classes_def.xml b/DataFormats/Vertex/src/classes_def.xml deleted file mode 100644 index 3e97f973b2e3e..0000000000000 --- a/DataFormats/Vertex/src/classes_def.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - >::ROOTReadStreamer(newObj, onfile.layout_); - ]]> - - - - - diff --git a/DataFormats/Vertex/BuildFile.xml b/DataFormats/VertexSoA/BuildFile.xml similarity index 100% rename from DataFormats/Vertex/BuildFile.xml rename to DataFormats/VertexSoA/BuildFile.xml diff --git a/DataFormats/Vertex/README.md b/DataFormats/VertexSoA/README.md similarity index 92% rename from DataFormats/Vertex/README.md rename to DataFormats/VertexSoA/README.md index 3e495d15f776e..7f91163c67787 100644 --- a/DataFormats/Vertex/README.md +++ b/DataFormats/VertexSoA/README.md @@ -8,7 +8,7 @@ contained in the deprecated `ZVertexSoA` class. The host format is inheriting from `CUDADataFormats/Common/interface/PortableHostCollection.h`, while the device format is inheriting from `CUDADataFormats/Common/interface/PortableDeviceCollection.h` -Both formats use the same SoA Layout (`ZVertexSoAHeterogeneousLayout`) which is generated +Both formats use the same SoA Layout (`ZVertexLayout`) which is generated via the `GENERATE_SOA_LAYOUT` macro in the `ZVertexUtilities.h` file. ## Notes @@ -38,7 +38,7 @@ possible on the host side. ## Utilities -Apart from `ZVertexSoAHeterogeneousLayout`, `ZVertexUtilities.h` also contains +Apart from `ZVertexLayout`, `ZVertexUtilities.h` also contains a collection of methods which were originally defined as class methods inside the `ZVertexSoA` class which have been adapted to operate on `View` instances, so that they are callable diff --git a/DataFormats/Vertex/interface/ZVertexDefinitions.h b/DataFormats/VertexSoA/interface/ZVertexDefinitions.h similarity index 100% rename from DataFormats/Vertex/interface/ZVertexDefinitions.h rename to DataFormats/VertexSoA/interface/ZVertexDefinitions.h diff --git a/DataFormats/VertexSoA/interface/ZVertexDevice.h b/DataFormats/VertexSoA/interface/ZVertexDevice.h new file mode 100644 index 0000000000000..6c351c68544ed --- /dev/null +++ b/DataFormats/VertexSoA/interface/ZVertexDevice.h @@ -0,0 +1,29 @@ +#ifndef DataFormats_Vertex_interface_ZVertexDevice_h +#define DataFormats_Vertex_interface_ZVertexDevice_h + +#include + +#include +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" +#include "DataFormats/VertexSoA/interface/ZVertexDefinitions.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" +#include "DataFormats/Portable/interface/PortableDeviceCollection.h" +#include "HeterogeneousCore/AlpakaInterface/interface/config.h" +#include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" + +template +class ZVertexDeviceSoA : public PortableDeviceCollection, TDev> { +public: + ZVertexDeviceSoA() = default; // necessary for ROOT dictionaries + + // Constructor which specifies the SoA size + template + explicit ZVertexDeviceSoA(TQueue queue) : PortableDeviceCollection, TDev>(S, queue) {} +}; + +using namespace ::zVertex; +template +using ZVertexDevice = ZVertexDeviceSoA; + +#endif // DataFormats_Vertex_interface_ZVertexDevice_h diff --git a/DataFormats/VertexSoA/interface/ZVertexHost.h b/DataFormats/VertexSoA/interface/ZVertexHost.h new file mode 100644 index 0000000000000..ef00fa41cf071 --- /dev/null +++ b/DataFormats/VertexSoA/interface/ZVertexHost.h @@ -0,0 +1,29 @@ +#ifndef DataFormats_Vertex_ZVertexHost_H +#define DataFormats_Vertex_ZVertexHost_H + +#include + +#include +#include "HeterogeneousCore/AlpakaInterface/interface/config.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" +#include "DataFormats/VertexSoA/interface/ZVertexDefinitions.h" +#include "DataFormats/Portable/interface/PortableHostCollection.h" + +template +class ZVertexHostSoA : public PortableHostCollection> { +public: + ZVertexHostSoA() = default; + + // Constructor which specifies the queue + template + explicit ZVertexHostSoA(TQueue queue) : PortableHostCollection>(S, queue) {} + + // Constructor which specifies the DevHost + explicit ZVertexHostSoA(alpaka_common::DevHost const& host) + : PortableHostCollection>(S, host) {} +}; + +using namespace ::zVertex; +using ZVertexHost = ZVertexHostSoA; + +#endif // DataFormats_Vertex_ZVertexHost_H diff --git a/DataFormats/Vertex/interface/ZVertexLayout.h b/DataFormats/VertexSoA/interface/ZVertexSoA.h similarity index 65% rename from DataFormats/Vertex/interface/ZVertexLayout.h rename to DataFormats/VertexSoA/interface/ZVertexSoA.h index 5c8fc6265b0eb..54a39770dda9b 100644 --- a/DataFormats/Vertex/interface/ZVertexLayout.h +++ b/DataFormats/VertexSoA/interface/ZVertexSoA.h @@ -1,10 +1,10 @@ -#ifndef DataFormats_Vertex_ZVertexLayout_h -#define DataFormats_Vertex_ZVertexLayout_h +#ifndef DataFormats_Vertex_ZVertexSoA_h +#define DataFormats_Vertex_ZVertexSoA_h #include #include "DataFormats/SoATemplate/interface/SoALayout.h" -GENERATE_SOA_LAYOUT(ZVertexSoAHeterogeneousLayout, +GENERATE_SOA_LAYOUT(ZVertexLayout, SOA_COLUMN(int16_t, idv), SOA_COLUMN(float, zv), SOA_COLUMN(float, wv), @@ -18,9 +18,9 @@ GENERATE_SOA_LAYOUT(ZVertexSoAHeterogeneousLayout, // They operate on View and ConstView of the ZVertexSoA. namespace zVertex { // Common types for both Host and Device code - using ZVertexSoALayout = ZVertexSoAHeterogeneousLayout<>; - using ZVertexSoAView = ZVertexSoAHeterogeneousLayout<>::View; - using ZVertexSoAConstView = ZVertexSoAHeterogeneousLayout<>::ConstView; + using ZVertexSoA = ZVertexLayout<>; + using ZVertexSoAView = ZVertexLayout<>::View; + using ZVertexSoAConstView = ZVertexLayout<>::ConstView; } // namespace zVertex diff --git a/DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h b/DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h new file mode 100644 index 0000000000000..7c05807851a9a --- /dev/null +++ b/DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h @@ -0,0 +1,40 @@ +#ifndef DataFormats_Vertex_interface_ZVertexSoACollection_h +#define DataFormats_Vertex_interface_ZVertexSoACollection_h + +#include + +#include +#include "DataFormats/Portable/interface/alpaka/PortableCollection.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" +#include "DataFormats/VertexSoA/interface/ZVertexDefinitions.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" +#include "DataFormats/VertexSoA/interface/ZVertexDevice.h" +#include "HeterogeneousCore/AlpakaInterface/interface/config.h" +#include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" + +namespace ALPAKA_ACCELERATOR_NAMESPACE { + + using ZVertexCollection = + std::conditional_t, ZVertexHost, ZVertexDevice>; + +} // namespace ALPAKA_ACCELERATOR_NAMESPACE + +namespace cms::alpakatools { + template + struct CopyToHost> { + template + static auto copyAsync(TQueue& queue, ZVertexDevice const& deviceData) { + ZVertexHost hostData(queue); + alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer()); + #ifdef GPU_DEBUG + printf("ZVertexCollection: I'm copying to host.\n"); + #endif + return hostData; + } + }; +} // namespace cms::alpakatools + +ASSERT_DEVICE_MATCHES_HOST_COLLECTION(ZVertexCollection, ZVertexHost); + +#endif // DataFormats_Vertex_interface_ZVertexSoACollection_h diff --git a/DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h b/DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h similarity index 57% rename from DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h rename to DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h index 805df3fe02c53..631f3942aa5cb 100644 --- a/DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h +++ b/DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h @@ -1,16 +1,16 @@ #ifndef DataFormats_Vertex_ZVertexUtilities_h #define DataFormats_Vertex_ZVertexUtilities_h #include -#include "DataFormats/Vertex/interface/ZVertexLayout.h" -#include "DataFormats/Vertex/interface/ZVertexDefinitions.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" +#include "DataFormats/VertexSoA/interface/ZVertexDefinitions.h" // Previous ZVertexSoA class methods. // They operate on View and ConstView of the ZVertexSoA. namespace zVertex { namespace utilities { - using ZVertexSoALayout = ZVertexSoAHeterogeneousLayout<>; - using ZVertexSoAView = ZVertexSoAHeterogeneousLayout<>::View; - using ZVertexSoAConstView = ZVertexSoAHeterogeneousLayout<>::ConstView; + using ZVertexSoA = ZVertexLayout<>; + using ZVertexSoAView = ZVertexLayout<>::View; + using ZVertexSoAConstView = ZVertexLayout<>::ConstView; ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE void init(ZVertexSoAView &vertices) { vertices.nvFinal() = 0; } diff --git a/DataFormats/Vertex/src/alpaka/classes_cuda.h b/DataFormats/VertexSoA/src/alpaka/classes_cuda.h similarity index 58% rename from DataFormats/Vertex/src/alpaka/classes_cuda.h rename to DataFormats/VertexSoA/src/alpaka/classes_cuda.h index 33ae44d696b8f..eab6eafe20111 100644 --- a/DataFormats/Vertex/src/alpaka/classes_cuda.h +++ b/DataFormats/VertexSoA/src/alpaka/classes_cuda.h @@ -3,8 +3,8 @@ #include "DataFormats/Common/interface/DeviceProduct.h" #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/Vertex/interface/ZVertexLayout.h" -#include "DataFormats/Vertex/interface//ZVertexSoADevice.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" +#include "DataFormats/VertexSoA/interface//ZVertexDevice.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h" #endif // DataFormats_Vertex_src_alpaka_classes_cuda_h diff --git a/DataFormats/Vertex/src/alpaka/classes_cuda_def.xml b/DataFormats/VertexSoA/src/alpaka/classes_cuda_def.xml similarity index 90% rename from DataFormats/Vertex/src/alpaka/classes_cuda_def.xml rename to DataFormats/VertexSoA/src/alpaka/classes_cuda_def.xml index e38a9c40df99a..c78930d1595e2 100644 --- a/DataFormats/Vertex/src/alpaka/classes_cuda_def.xml +++ b/DataFormats/VertexSoA/src/alpaka/classes_cuda_def.xml @@ -1,5 +1,5 @@ - + diff --git a/DataFormats/Vertex/src/alpaka/classes_rocm.h b/DataFormats/VertexSoA/src/alpaka/classes_rocm.h similarity index 58% rename from DataFormats/Vertex/src/alpaka/classes_rocm.h rename to DataFormats/VertexSoA/src/alpaka/classes_rocm.h index cd0cf1ca0a1b4..d4b6e51d70b94 100644 --- a/DataFormats/Vertex/src/alpaka/classes_rocm.h +++ b/DataFormats/VertexSoA/src/alpaka/classes_rocm.h @@ -3,7 +3,7 @@ #include "DataFormats/Common/interface/DeviceProduct.h" #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/Vertex/interface/ZVertexLayout.h" -#include "DataFormats/Vertex/interface//ZVertexSoADevice.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" +#include "DataFormats/VertexSoA/interface//ZVertexDevice.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h" #endif // DataFormats_Vertex_src_alpaka_classes_rocm_h diff --git a/DataFormats/Vertex/src/alpaka/classes_rocm_def.xml b/DataFormats/VertexSoA/src/alpaka/classes_rocm_def.xml similarity index 90% rename from DataFormats/Vertex/src/alpaka/classes_rocm_def.xml rename to DataFormats/VertexSoA/src/alpaka/classes_rocm_def.xml index 435d4ebad8283..9865d1e742d0c 100644 --- a/DataFormats/Vertex/src/alpaka/classes_rocm_def.xml +++ b/DataFormats/VertexSoA/src/alpaka/classes_rocm_def.xml @@ -1,5 +1,5 @@ - + diff --git a/DataFormats/VertexSoA/src/classes.cc b/DataFormats/VertexSoA/src/classes.cc new file mode 100644 index 0000000000000..91c2f65c57bab --- /dev/null +++ b/DataFormats/VertexSoA/src/classes.cc @@ -0,0 +1,4 @@ +#include "DataFormats/Portable/interface/PortableHostCollectionReadRules.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" + +SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection); diff --git a/DataFormats/Vertex/src/classes.h b/DataFormats/VertexSoA/src/classes.h similarity index 61% rename from DataFormats/Vertex/src/classes.h rename to DataFormats/VertexSoA/src/classes.h index 8f295cac21d4e..660704eaf86af 100644 --- a/DataFormats/Vertex/src/classes.h +++ b/DataFormats/VertexSoA/src/classes.h @@ -2,7 +2,7 @@ #define DataFormats_Vertex_src_classes_h #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/Vertex/interface/ZVertexLayout.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" #endif // DataFormats_Vertex_src_classes_h diff --git a/DataFormats/VertexSoA/src/classes_def.xml b/DataFormats/VertexSoA/src/classes_def.xml new file mode 100644 index 0000000000000..a5189975a2028 --- /dev/null +++ b/DataFormats/VertexSoA/src/classes_def.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/DataFormats/Vertex/test/BuildFile.xml b/DataFormats/VertexSoA/test/BuildFile.xml similarity index 100% rename from DataFormats/Vertex/test/BuildFile.xml rename to DataFormats/VertexSoA/test/BuildFile.xml diff --git a/DataFormats/Vertex/test/alpaka/ZVertexSoA_test.cc b/DataFormats/VertexSoA/test/alpaka/ZVertexSoA_test.cc similarity index 93% rename from DataFormats/Vertex/test/alpaka/ZVertexSoA_test.cc rename to DataFormats/VertexSoA/test/alpaka/ZVertexSoA_test.cc index 1099fc3fd7ed8..1b1fcfca321c4 100644 --- a/DataFormats/Vertex/test/alpaka/ZVertexSoA_test.cc +++ b/DataFormats/VertexSoA/test/alpaka/ZVertexSoA_test.cc @@ -15,9 +15,9 @@ #include #include -#include "DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h" -#include "DataFormats/Vertex/interface/ZVertexSoADevice.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h" +#include "DataFormats/VertexSoA/interface/ZVertexDevice.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" #include "HeterogeneousCore/AlpakaInterface/interface/devices.h" #include "HeterogeneousCore/AlpakaInterface/interface/host.h" #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" diff --git a/DataFormats/Vertex/test/alpaka/ZVertexSoA_test.dev.cc b/DataFormats/VertexSoA/test/alpaka/ZVertexSoA_test.dev.cc similarity index 92% rename from DataFormats/Vertex/test/alpaka/ZVertexSoA_test.dev.cc rename to DataFormats/VertexSoA/test/alpaka/ZVertexSoA_test.dev.cc index cbd6e7f2d5146..7b23e2b9f1520 100644 --- a/DataFormats/Vertex/test/alpaka/ZVertexSoA_test.dev.cc +++ b/DataFormats/VertexSoA/test/alpaka/ZVertexSoA_test.dev.cc @@ -1,6 +1,6 @@ -#include "DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h" -#include "DataFormats/Vertex/interface/ZVertexSoADevice.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h" +#include "DataFormats/VertexSoA/interface/ZVertexDevice.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" // Check if this is really needed; code doesn't compile without it namespace ALPAKA_ACCELERATOR_NAMESPACE { diff --git a/HLTrigger/Configuration/python/customizeHLTforPatatrack.py b/HLTrigger/Configuration/python/customizeHLTforPatatrack.py index 7d0cab3658b03..4d5a540cf4d68 100644 --- a/HLTrigger/Configuration/python/customizeHLTforPatatrack.py +++ b/HLTrigger/Configuration/python/customizeHLTforPatatrack.py @@ -188,8 +188,8 @@ def customizeHLTforAlpakaPixelRecoLocal(process): # - FEDRawDataCollection # produces (* optional) # - SiPixelClustersSoA - # - SiPixelDigisCollection - # - SiPixelDigiErrorsCollection * + # - SiPixelDigisSoACollection + # - SiPixelDigiErrorsSoACollection * # - SiPixelFormatterErrors * process.hltSiPixelClusters = cms.EDProducer('SiPixelRawToClusterPhase1@alpaka', mightGet = cms.optional.untracked.vstring, @@ -250,9 +250,9 @@ def customizeHLTforAlpakaPixelRecoLocal(process): # consumes # - BeamSpotDevice # - SiPixelClustersSoA - # - SiPixelDigisCollection + # - SiPixelDigisSoACollection # produces - # - TrackingRecHitAlpakaCollection + # - TrackingRecHitsSoACollection process.hltSiPixelRecHits = cms.EDProducer('SiPixelRecHitAlpakaPhase1@alpaka', beamSpot = cms.InputTag('hltOnlineBeamSpotDevice'), src = cms.InputTag('hltSiPixelClusters'), @@ -332,7 +332,7 @@ def customizeHLTforAlpakaPixelRecoTracking(process): # alpaka EDProducer # consumes - # - TrackingRecHitAlpakaCollection + # - TrackingRecHitsSoACollection # produces # - TkSoADevice process.hltPixelTracks = cms.EDProducer('CAHitNtupletAlpakaPhase1@alpaka', diff --git a/HeterogeneousCore/AlpakaInterface/interface/OneToManyAssoc.h b/HeterogeneousCore/AlpakaInterface/interface/OneToManyAssoc.h index d4e3a65ae5de7..c1ea4fed8e32b 100644 --- a/HeterogeneousCore/AlpakaInterface/interface/OneToManyAssoc.h +++ b/HeterogeneousCore/AlpakaInterface/interface/OneToManyAssoc.h @@ -251,7 +251,14 @@ namespace cms { int32_t *ppsws = (int32_t *)((char *)(h) + offsetof(OneToManyAssocRandomAccess, psws)); auto nthreads = 1024; auto nblocks = (nOnes + nthreads - 1) / nthreads; - auto workDiv = cms::alpakatools::make_workdiv(nblocks, nthreads); + auto workDiv = cms::alpakatools::make_workdiv(nblocks, nthreads); + + auto numberOfWarps = 32; + #ifndef ALPAKA_ACC_GPU_CUDA_ENABLED + printf("uhm"); + numberOfWarps = alpaka::getWarpSizes(alpaka::getDev(queue))[0]; + #endif + alpaka::exec(queue, workDiv, multiBlockPrefixScan(), @@ -260,7 +267,7 @@ namespace cms { nOnes, nblocks, ppsws, - alpaka::getWarpSizes(alpaka::getDev(queue))[0]); + numberOfWarps); } else { h->finalize(); } diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/BuildFile.xml b/RecoLocalTracker/SiPixelClusterizer/plugins/BuildFile.xml index 565b70b7fefbb..12648a28f472e 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/BuildFile.xml +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/BuildFile.xml @@ -1,8 +1,8 @@ - - + + diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelRawToClusterGPUKernel.h b/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelRawToClusterGPUKernel.h index 56cd6a599bb24..ac08372d15594 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelRawToClusterGPUKernel.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelRawToClusterGPUKernel.h @@ -132,12 +132,13 @@ namespace pixelgpudetails { assert(nModules_Clusters_h[2] <= nModules_Clusters_h[1]); clusters_d.setNClusters(nModules_Clusters_h[1], nModules_Clusters_h[2]); + #ifdef GPU_DEBUG std::cout << "SiPixelClusterizerCUDA results:" << std::endl << " > no. of digis: " << nDigis << std::endl << " > no. of active modules: " << nModules_Clusters_h[0] << std::endl << " > no. of clusters: " << nModules_Clusters_h[1] << std::endl << " > bpix2 offset: " << nModules_Clusters_h[2] << std::endl; - + #endif // need to explicitly deallocate while the associated CUDA // stream is still alive // diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/CalibPixel.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/CalibPixel.h index 45cabaada47d9..e610556e21e65 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/CalibPixel.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/CalibPixel.h @@ -14,7 +14,7 @@ #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsSoA.h" -#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "HeterogeneousCore/AlpakaInterface/interface/traits.h" @@ -30,7 +30,7 @@ namespace calibPixel { template ALPAKA_FN_ACC void operator()(const TAcc& acc, SiPixelClusterThresholds clusterThresholds, - SiPixelDigisSoAv2View view, + SiPixelDigisSoAView view, SiPixelClustersSoAView clus_view, const SiPixelGainCalibrationForHLTSoAConstView gains, int numElements) const { @@ -89,7 +89,7 @@ namespace calibPixel { template ALPAKA_FN_ACC void operator()(const TAcc& acc, SiPixelClusterThresholds clusterThresholds, - SiPixelDigisSoAv2View view, + SiPixelDigisSoAView view, SiPixelClustersSoAView clus_view, int numElements) const { const float ElectronPerADCGain = clusterThresholds.electronPerADCGain; diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/ClusterChargeCut.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/ClusterChargeCut.h index f9f9cd88fd018..4c8c9d2667a9b 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/ClusterChargeCut.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/ClusterChargeCut.h @@ -6,7 +6,7 @@ #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" -#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoAv2.h" +#include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "HeterogeneousCore/AlpakaInterface/interface/prefixScan.h" #include "RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelClusterThresholds.h" @@ -20,7 +20,7 @@ namespace pixelClustering { template ALPAKA_FN_ACC void operator()( const TAcc& acc, - SiPixelDigisSoAv2View digi_view, + SiPixelDigisSoAView digi_view, SiPixelClustersSoAView clus_view, SiPixelClusterThresholds clusterThresholds, // charge cut on cluster in electrons (for layer 1 and for other layers) diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h index d4234686da58f..a493b2e1593d6 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h @@ -87,7 +87,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { struct countModules { template ALPAKA_FN_ACC void operator()(const TAcc& acc, - SiPixelDigisSoAv2View digi_view, + SiPixelDigisSoAView digi_view, SiPixelClustersSoAView clus_view, const unsigned int numElements) const { [[maybe_unused]] constexpr int nMaxModules = TrackerTraits::numberOfModules; @@ -122,7 +122,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { struct findClus { template ALPAKA_FN_ACC void operator()(const TAcc& acc, - SiPixelDigisSoAv2View digi_view, + SiPixelDigisSoAView digi_view, SiPixelClustersSoAView clus_view, const unsigned int numElements) const { constexpr bool isPhase2 = std::is_base_of::value; diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelPhase2DigiToCluster.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelPhase2DigiToCluster.cc index 03866830e6cff..cf53ac43d0628 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelPhase2DigiToCluster.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelPhase2DigiToCluster.cc @@ -5,13 +5,13 @@ #include #include -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsDevice.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "DataFormats/Common/interface/DetSetVector.h" @@ -53,9 +53,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const edm::ESGetToken geomToken_; const edm::EDGetTokenT> pixelDigiToken_; - device::EDPutToken digiPutToken_; - device::EDPutToken digiErrorPutToken_; - device::EDPutToken clusterPutToken_; + device::EDPutToken digiPutToken_; + device::EDPutToken digiErrorPutToken_; + device::EDPutToken clusterPutToken_; Algo Algo_; @@ -63,7 +63,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const SiPixelClusterThresholds clusterThresholds_; uint32_t nDigis_ = 0; - SiPixelDigisCollection digis_d; + SiPixelDigisSoACollection digis_d; }; SiPixelPhase2DigiToCluster::SiPixelPhase2DigiToCluster(const edm::ParameterSet& iConfig) @@ -134,7 +134,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { } } - digis_d = SiPixelDigisCollection(nDigis, iEvent.queue()); + digis_d = SiPixelDigisSoACollection(nDigis, iEvent.queue()); alpaka::memcpy(iEvent.queue(), digis_d.buffer(), digis_h.buffer()); Algo_.makePhase2ClustersAsync(clusterThresholds_, digis_d.view(), nDigis, iEvent.queue()); @@ -142,11 +142,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { void SiPixelPhase2DigiToCluster::produce(device::Event& iEvent, device::EventSetup const& iSetup) { if (nDigis_ == 0) { - SiPixelClustersCollection clusters_d{pixelTopology::Phase1::numberOfModules, iEvent.queue()}; + SiPixelClustersSoACollection clusters_d{pixelTopology::Phase1::numberOfModules, iEvent.queue()}; iEvent.emplace(digiPutToken_, std::move(digis_d)); iEvent.emplace(clusterPutToken_, std::move(clusters_d)); if (includeErrors_) { - iEvent.emplace(digiErrorPutToken_, SiPixelDigiErrorsCollection()); + iEvent.emplace(digiErrorPutToken_, SiPixelDigiErrorsSoACollection()); } return; } diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToCluster.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToCluster.cc index 96157b786dd9c..f6235b9298a11 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToCluster.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToCluster.cc @@ -4,13 +4,13 @@ #include #include -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsDevice.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" #include "CondFormats/SiPixelObjects/interface/alpaka/SiPixelMappingDevice.h" #include "CondFormats/SiPixelObjects/interface/alpaka/SiPixelMappingUtilities.h" @@ -64,9 +64,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { edm::EDGetTokenT rawGetToken_; edm::EDPutTokenT fmtErrorToken_; - device::EDPutToken digiPutToken_; - device::EDPutToken digiErrorPutToken_; - device::EDPutToken clusterPutToken_; + device::EDPutToken digiPutToken_; + device::EDPutToken digiErrorPutToken_; + device::EDPutToken clusterPutToken_; edm::ESWatcher recordWatcher_; const device::ESGetToken mapToken_; diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc index 7caa2219fc695..2cd37ef95c6ac 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc @@ -335,7 +335,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const uint32_t wordCounter, const uint32_t *word, const uint8_t *fedIds, - SiPixelDigisSoAv2View digisView, + SiPixelDigisSoAView digisView, SiPixelDigiErrorsSoAView err, bool useQualityInfo, bool includeErrors, @@ -565,11 +565,11 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { std::cout << "decoding " << wordCounter << " digis." << std::endl; #endif constexpr int numberOfModules = TrackerTraits::numberOfModules; - digis_d = SiPixelDigisCollection(wordCounter, queue); + digis_d = SiPixelDigisSoACollection(wordCounter, queue); if (includeErrors) { - digiErrors_d = SiPixelDigiErrorsCollection(wordCounter, queue); + digiErrors_d = SiPixelDigiErrorsSoACollection(wordCounter, queue); } - clusters_d = SiPixelClustersCollection(numberOfModules, queue); + clusters_d = SiPixelClustersSoACollection(numberOfModules, queue); if (wordCounter) // protect in case of empty event.... { const int threadsPerBlockOrElementsPerThread = []() { @@ -595,7 +595,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // Launch rawToDigi kernel alpaka::exec(queue, workDiv, - RawToDigi_kernel(), + RawToDigi_kernel{}, cablingMap, modToUnp, wordCounter, @@ -632,7 +632,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const auto workDiv = cms::alpakatools::make_workdiv(blocks, threadsPerBlockOrElementsPerThread); alpaka::exec( - queue, workDiv, calibDigis(), clusterThresholds, digis_d->view(), clusters_d->view(), gains, wordCounter); + queue, workDiv, calibDigis{}, clusterThresholds, digis_d->view(), clusters_d->view(), gains, wordCounter); #ifdef GPU_DEBUG alpaka::wait(queue); @@ -641,7 +641,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { #endif alpaka::exec( - queue, workDiv, countModules(), digis_d->view(), clusters_d->view(), wordCounter); + queue, workDiv, countModules{}, digis_d->view(), clusters_d->view(), wordCounter); auto moduleStartFirstElement = cms::alpakatools::make_device_view(alpaka::getDev(queue), clusters_d->view().moduleStart(), 1u); @@ -660,7 +660,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { #endif alpaka::exec( - queue, workDivMaxNumModules, findClus(), digis_d->view(), clusters_d->view(), wordCounter); + queue, workDivMaxNumModules, findClus{}, digis_d->view(), clusters_d->view(), wordCounter); #ifdef GPU_DEBUG alpaka::wait(queue); @@ -669,7 +669,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // apply charge cut alpaka::exec(queue, workDivMaxNumModules, - ::pixelClustering::clusterChargeCut(), + ::pixelClustering::clusterChargeCut{}, digis_d->view(), clusters_d->view(), clusterThresholds, @@ -681,7 +681,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // MUST be ONE block const auto workDivOneBlock = cms::alpakatools::make_workdiv(1u, 1024u); - alpaka::exec(queue, workDivOneBlock, fillHitsModuleStart(), clusters_d->view()); + alpaka::exec(queue, workDivOneBlock, fillHitsModuleStart{}, clusters_d->view()); // last element holds the number of all clusters const auto clusModuleStartLastElement = cms::alpakatools::make_device_view( @@ -714,14 +714,14 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template void SiPixelRawToClusterKernel::makePhase2ClustersAsync( const SiPixelClusterThresholds clusterThresholds, - SiPixelDigisSoAv2View &digis_view, + SiPixelDigisSoAView &digis_view, const uint32_t numDigis, Queue &queue) { using namespace pixelClustering; using pixelTopology::Phase2; nDigis = numDigis; constexpr int numberOfModules = pixelTopology::Phase2::numberOfModules; - clusters_d = SiPixelClustersCollection(numberOfModules, queue); + clusters_d = SiPixelClustersSoACollection(numberOfModules, queue); const auto threadsPerBlockOrElementsPerThread = 512; const auto blocks = cms::alpakatools::divide_up_by(std::max(numDigis, numberOfModules), threadsPerBlockOrElementsPerThread); @@ -736,7 +736,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { << " threadsPerBlockOrElementsPerThread\n"; #endif alpaka::exec( - queue, workDiv, countModules(), digis_view, clusters_d->view(), numDigis); + queue, workDiv, countModules{}, digis_view, clusters_d->view(), numDigis); auto moduleStartFirstElement = cms::alpakatools::make_device_view(alpaka::getDev(queue), clusters_d->view().moduleStart(), 1u); @@ -753,7 +753,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { << " threadsPerBlockOrElementsPerThread\n"; #endif alpaka::exec( - queue, workDivMaxNumModules, findClus(), digis_view, clusters_d->view(), numDigis); + queue, workDivMaxNumModules, findClus{}, digis_view, clusters_d->view(), numDigis); #ifdef GPU_DEBUG alpaka::wait(queue); #endif @@ -761,7 +761,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // apply charge cut alpaka::exec(queue, workDivMaxNumModules, - ::pixelClustering::clusterChargeCut(), + ::pixelClustering::clusterChargeCut{}, digis_view, clusters_d->view(), clusterThresholds, @@ -774,7 +774,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // MUST be ONE block const auto workDivOneBlock = cms::alpakatools::make_workdiv(1u, 1024u); - alpaka::exec(queue, workDivOneBlock, fillHitsModuleStart(), clusters_d->view()); + alpaka::exec(queue, workDivOneBlock, fillHitsModuleStart{}, clusters_d->view()); // last element holds the number of all clusters const auto clusModuleStartLastElement = cms::alpakatools::make_device_view( diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.h index c5be774416b70..46c6ca1db0f17 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.h @@ -8,11 +8,11 @@ #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsCollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigiErrorsSoACollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" @@ -165,21 +165,21 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { Queue& queue); void makePhase2ClustersAsync(const SiPixelClusterThresholds clusterThresholds, - SiPixelDigisSoAv2View& digis_view, + SiPixelDigisSoAView& digis_view, const uint32_t numDigis, Queue& queue); - SiPixelDigisCollection getDigis() { + SiPixelDigisSoACollection getDigis() { digis_d->setNModulesDigis(nModules_Clusters_h[0], nDigis); return std::move(*digis_d); } - SiPixelClustersCollection getClusters() { + SiPixelClustersSoACollection getClusters() { clusters_d->setNClusters(nModules_Clusters_h[1], nModules_Clusters_h[2]); return std::move(*clusters_d); } - SiPixelDigiErrorsCollection getErrors() { return std::move(*digiErrors_d); } + SiPixelDigiErrorsSoACollection getErrors() { return std::move(*digiErrors_d); } auto nModules() { return nModules_Clusters_h[0]; } @@ -188,9 +188,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // Data to be put in the event cms::alpakatools::host_buffer nModules_Clusters_h; - std::optional digis_d; - std::optional clusters_d; - std::optional digiErrors_d; + std::optional digis_d; + std::optional clusters_d; + std::optional digiErrors_d; }; } // namespace pixelDetails diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromSoAAlpaka.cc b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromSoAAlpaka.cc index c1d438b8b4e10..19fa38ee2250f 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromSoAAlpaka.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromSoAAlpaka.cc @@ -7,8 +7,8 @@ #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/SiPixelCluster/interface/SiPixelCluster.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoAHost.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsHost.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" @@ -26,7 +26,7 @@ template class SiPixelRecHitFromSoAAlpaka : public edm::global::EDProducer<> { - using HitModuleStartArray = typename TrackingRecHitAlpakaSoA::HitModuleStartArray; + using HitModuleStartArray = typename TrackingRecHitSoA::HitModuleStartArray; using hindex_type = typename TrackerTraits::hindex_type; using HMSstorage = typename std::vector; diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.h b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitKernel.h similarity index 63% rename from RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.h rename to RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitKernel.h index bfd13813a47a0..9e954fec65089 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.h +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitKernel.h @@ -1,17 +1,17 @@ -#ifndef RecoLocalTracker_SiPixelRecHits_PixelRecHitGPUKernel_h -#define RecoLocalTracker_SiPixelRecHits_PixelRecHitGPUKernel_h +#ifndef RecoLocalTracker_SiPixelRecHits_PixelRecHitKernel_h +#define RecoLocalTracker_SiPixelRecHits_PixelRecHitKernel_h #include #include #include "DataFormats/BeamSpot/interface/BeamSpotPOD.h" -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h" -#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h" @@ -21,20 +21,20 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { using namespace cms::alpakatools; template - class PixelRecHitGPUKernel { + class PixelRecHitKernel { public: - PixelRecHitGPUKernel() = default; - ~PixelRecHitGPUKernel() = default; + PixelRecHitKernel() = default; + ~PixelRecHitKernel() = default; - PixelRecHitGPUKernel(const PixelRecHitGPUKernel&) = delete; - PixelRecHitGPUKernel(PixelRecHitGPUKernel&&) = delete; - PixelRecHitGPUKernel& operator=(const PixelRecHitGPUKernel&) = delete; - PixelRecHitGPUKernel& operator=(PixelRecHitGPUKernel&&) = delete; + PixelRecHitKernel(const PixelRecHitKernel&) = delete; + PixelRecHitKernel(PixelRecHitKernel&&) = delete; + PixelRecHitKernel& operator=(const PixelRecHitKernel&) = delete; + PixelRecHitKernel& operator=(PixelRecHitKernel&&) = delete; using ParamsOnDevice = pixelCPEforDevice::ParamsOnDeviceT; - TrackingRecHitAlpakaCollection makeHitsAsync(SiPixelDigisCollection const& digis_d, - SiPixelClustersCollection const& clusters_d, + TrackingRecHitsSoACollection makeHitsAsync(SiPixelDigisSoACollection const& digis_d, + SiPixelClustersSoACollection const& clusters_d, BeamSpotPOD const* bs_d, ParamsOnDevice const* cpeParams, Queue queue) const; @@ -42,4 +42,4 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { } // namespace pixelgpudetails } // namespace ALPAKA_ACCELERATOR_NAMESPACE -#endif // RecoLocalTracker_SiPixelRecHits_PixelRecHitGPUKernel_h +#endif // RecoLocalTracker_SiPixelRecHits_PixelRecHitKernel_h diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.dev.cc b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitKernels.dev.cc similarity index 78% rename from RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.dev.cc rename to RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitKernels.dev.cc index a1a282257c49c..07e33ff81f997 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.dev.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitKernels.dev.cc @@ -11,7 +11,7 @@ #include "HeterogeneousCore/AlpakaInterface/interface/HistoContainer.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "PixelRecHitGPUKernel.h" +#include "PixelRecHitKernel.h" #include "PixelRecHits.h" //#define GPU_DEBUG @@ -46,9 +46,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { namespace pixelgpudetails { template - TrackingRecHitAlpakaCollection PixelRecHitGPUKernel::makeHitsAsync( - SiPixelDigisCollection const& digis_d, - SiPixelClustersCollection const& clusters_d, + TrackingRecHitsSoACollection PixelRecHitKernel::makeHitsAsync( + SiPixelDigisSoACollection const& digis_d, + SiPixelClustersSoACollection const& clusters_d, BeamSpotPOD const* bs_d, pixelCPEforDevice::ParamsOnDeviceT const* cpeParams, Queue queue) const { @@ -56,7 +56,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { auto nHits = clusters_d.nClusters(); auto offsetBPIX2 = clusters_d.offsetBPIX2(); - TrackingRecHitAlpakaCollection hits_d(nHits, offsetBPIX2, clusters_d->clusModuleStart(), queue); + TrackingRecHitsSoACollection hits_d(nHits, offsetBPIX2, clusters_d->clusModuleStart(), queue); int activeModulesWithDigis = digis_d.nModules(); @@ -93,7 +93,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { cpeParams, hits_d.view().hitsLayerStart().data()); constexpr auto nLayers = TrackerTraits::numberOfLayers; + + // Use a view since it's runtime sized and can't use the implicit definition + // see HeterogeneousCore/AlpakaInterface/interface/OneToManyAssoc.h:100 + typename TrackingRecHitSoA::PhiBinnerView hrv_d; + hrv_d.assoc = &(hits_d.view().phiBinner()); + hrv_d.offSize = -1; + hrv_d.offStorage = nullptr; + hrv_d.contentSize = nHits; + hrv_d.contentStorage = hits_d.view().phiBinnerStorage(); + + cms::alpakatools::fillManyFromVector(&(hits_d.view().phiBinner()), + hrv_d, nLayers, hits_d.view().iphi(), hits_d.view().hitsLayerStart().data(), @@ -109,15 +121,15 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { #ifdef GPU_DEBUG alpaka::wait(queue); - std::cout << "PixelRecHitGPUKernel -> DONE!" << std::endl; + std::cout << "PixelRecHitKernel -> DONE!" << std::endl; #endif return hits_d; } - template class PixelRecHitGPUKernel; - template class PixelRecHitGPUKernel; - template class PixelRecHitGPUKernel; + template class PixelRecHitKernel; + template class PixelRecHitKernel; + template class PixelRecHitKernel; } // namespace pixelgpudetails } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHits.h b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHits.h index 03cc38365e02a..36e1df0dc390b 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHits.h +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHits.h @@ -12,8 +12,8 @@ #include "DataFormats/Math/interface/approx_atan2.h" #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" @@ -30,10 +30,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { ALPAKA_FN_ACC void operator()(const TAcc& acc, pixelCPEforDevice::ParamsOnDeviceT const* __restrict__ cpeParams, BeamSpotPOD const* __restrict__ bs, - SiPixelDigisSoAv2ConstView digis, + SiPixelDigisSoAConstView digis, uint32_t numElements, SiPixelClustersSoAConstView clusters, - TrackingRecHitAlpakaSoAView hits) const { + TrackingRecHitSoAView hits) const { // FIXME // the compiler seems NOT to optimize loads from views (even in a simple test case) // The whole gimnastic here of copying or not is a pure heuristic exercise that seems to produce the fastest code with the above signature diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitAlpaka.cc b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitAlpaka.cc index 0b85ae2ba17ce..46fd8a6b8c2ca 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitAlpaka.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitAlpaka.cc @@ -1,11 +1,11 @@ #include "DataFormats/BeamSpot/interface/BeamSpotPOD.h" #include "DataFormats/BeamSpot/interface/alpaka/BeamSpotDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" -#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersSoACollection.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisDevice.h" -#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisCollection.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitSoADevice.h" -#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h" +#include "DataFormats/SiPixelDigiSoA/interface/alpaka/SiPixelDigisSoACollection.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsDevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" @@ -31,7 +31,7 @@ #include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h" #include "RecoLocalTracker/SiPixelRecHits/interface/alpaka/PixelCPEFastParamsCollection.h" -#include "PixelRecHitGPUKernel.h" +#include "PixelRecHitKernel.h" namespace ALPAKA_ACCELERATOR_NAMESPACE { template @@ -42,18 +42,16 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); - using ParamsOnGPU = pixelCPEforDevice::ParamsOnDeviceT; - private: void produce(edm::StreamID streamID, device::Event& iEvent, const device::EventSetup& iSetup) const override; const device::ESGetToken, PixelCPEFastParamsRecord> cpeToken_; const device::EDGetToken tBeamSpot; - const device::EDGetToken tokenClusters_; - const device::EDGetToken tokenDigi_; - const device::EDPutToken> tokenHit_; + const device::EDGetToken tokenClusters_; + const device::EDGetToken tokenDigi_; + const device::EDPutToken> tokenHit_; - const pixelgpudetails::PixelRecHitGPUKernel gpuAlgo_; + const pixelgpudetails::PixelRecHitKernel Algo_; }; template @@ -91,7 +89,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { auto const& bs = iEvent.get(tBeamSpot); iEvent.emplace(tokenHit_, - gpuAlgo_.makeHitsAsync(digis, clusters, bs.data(), fcpe.const_buffer().data(), iEvent.queue())); + Algo_.makeHitsAsync(digis, clusters, bs.data(), fcpe.const_buffer().data(), iEvent.queue())); } using SiPixelRecHitAlpakaPhase1 = SiPixelRecHitAlpaka; using SiPixelRecHitAlpakaPhase2 = SiPixelRecHitAlpaka; diff --git a/RecoTauTag/HLTProducers/BuildFile.xml b/RecoTauTag/HLTProducers/BuildFile.xml index 272cca42bf2f8..0b6b262fce08f 100644 --- a/RecoTauTag/HLTProducers/BuildFile.xml +++ b/RecoTauTag/HLTProducers/BuildFile.xml @@ -18,7 +18,7 @@ - + diff --git a/RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc b/RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc index 749a88fd603db..8fc751f337841 100644 --- a/RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc +++ b/RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc @@ -49,8 +49,8 @@ #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" namespace L2TauTagNNv1 { constexpr int nCellEta = 5; @@ -146,7 +146,7 @@ struct L2TauNNProducerAlpakaCacheData { class L2TauNNProducerAlpaka : public edm::stream::EDProducer> { public: - using TrackSoAHost = pixelTrack::TrackSoAHostPhase1; + using TracksHost = pixelTrack::TracksHostPhase1; struct caloRecHitCollections { const HBHERecHitCollection* hbhe; @@ -181,16 +181,16 @@ class L2TauNNProducerAlpaka : public edm::stream::EDProducer& allTaus, - const TrackSoAHost& patatracks_tsoa, + const TracksHost& patatracks_tsoa, const ZVertexHost& patavtx_soa, const reco::BeamSpot& beamspot, const MagneticField* magfi); void selectGoodTracksAndVertices(const ZVertexHost& patavtx_soa, - const TrackSoAHost& patatracks_tsoa, + const TracksHost& patatracks_tsoa, std::vector& trkGood, std::vector& vtxGood); std::pair impactParameter(int it, - const TrackSoAHost& patatracks_tsoa, + const TracksHost& patatracks_tsoa, float patatrackPhi, const reco::BeamSpot& beamspot, const MagneticField* magfi); @@ -210,7 +210,7 @@ class L2TauNNProducerAlpaka : public edm::stream::EDProducer geometryToken_; const edm::ESGetToken bFieldToken_; const edm::EDGetTokenT pataVerticesToken_; - const edm::EDGetTokenT pataTracksToken_; + const edm::EDGetTokenT pataTracksToken_; const edm::EDGetTokenT beamSpotToken_; const unsigned int maxVtx_; const float fractionSumPt2_; @@ -574,7 +574,7 @@ void L2TauNNProducerAlpaka::fillCaloRecHits(tensorflow::Tensor& cellGridMatrix, } void L2TauNNProducerAlpaka::selectGoodTracksAndVertices(const ZVertexHost& patavtx_soa, - const TrackSoAHost& patatracks_tsoa, + const TracksHost& patatracks_tsoa, std::vector& trkGood, std::vector& vtxGood) { using patatrackHelpers = TracksUtilities; @@ -622,7 +622,7 @@ void L2TauNNProducerAlpaka::selectGoodTracksAndVertices(const ZVertexHost& patav } std::pair L2TauNNProducerAlpaka::impactParameter(int it, - const TrackSoAHost& patatracks_tsoa, + const TracksHost& patatracks_tsoa, float patatrackPhi, const reco::BeamSpot& beamspot, const MagneticField* magfi) { @@ -654,7 +654,7 @@ std::pair L2TauNNProducerAlpaka::impactParameter(int it, void L2TauNNProducerAlpaka::fillPatatracks(tensorflow::Tensor& cellGridMatrix, const std::vector& allTaus, - const TrackSoAHost& patatracks_tsoa, + const TracksHost& patatracks_tsoa, const ZVertexHost& patavtx_soa, const reco::BeamSpot& beamspot, const MagneticField* magfi) { diff --git a/RecoTracker/Configuration/python/customizePixelOnlyForProfiling.py b/RecoTracker/Configuration/python/customizePixelOnlyForProfiling.py index 85131be421d6d..45b1777da1dae 100644 --- a/RecoTracker/Configuration/python/customizePixelOnlyForProfiling.py +++ b/RecoTracker/Configuration/python/customizePixelOnlyForProfiling.py @@ -8,7 +8,8 @@ def customizePixelOnlyForProfilingGPUOnly(process): process.consumer = cms.EDAnalyzer("GenericConsumer", - eventProducts = cms.untracked.vstring('pixelTracksCUDA', 'pixelVerticesCUDA','pixelTracksAlpaka','pixelVerticesAlpaka') + eventProducts = cms.untracked.vstring('pixelTracksCUDA', 'pixelVerticesCUDA') + ## When https://github.com/cms-sw/cmssw/pull/43338, for alpaka we will add *DeviceProduct_pixelTracksAlpaka_*_*, *DeviceProduct_pixelVerticesAlpaka_*_* ) process.consume_step = cms.EndPath(process.consumer) @@ -31,7 +32,7 @@ def customizePixelOnlyForProfilingGPUWithHostCopy(process): #? process.siPixelRecHitSoAFromLegacy.convertToLegacy = False process.consumer = cms.EDAnalyzer("GenericConsumer", - eventProducts = cms.untracked.vstring('pixelTracksSoA', 'pixelVerticesSoA') + eventProducts = cms.untracked.vstring('pixelTracksSoA', 'pixelVerticesSoA','pixelTracksAlpaka','pixelVerticesAlpaka') ) process.consume_step = cms.EndPath(process.consumer) diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc b/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc index 1e12f0dd9dd3c..6ccca74b0a854 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/BrokenLineFit.dev.cc @@ -7,7 +7,7 @@ #include #include -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/traits.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h" @@ -32,7 +32,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { ALPAKA_FN_ACC void operator()(TAcc const &acc, Tuples const *__restrict__ foundNtuplets, TupleMultiplicity const *__restrict__ tupleMultiplicity, - TrackingRecHitAlpakaSoAConstView hh, + TrackingRecHitSoAConstView hh, pixelCPEforDevice::ParamsOnDeviceT const *__restrict__ cpeParams, typename TrackerTraits::tindex_type *__restrict__ ptkids, double *__restrict__ phits, @@ -244,7 +244,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template void HelixFit::launchBrokenLineKernels( - const TrackingRecHitAlpakaSoAConstView &hv, + const TrackingRecHitSoAConstView &hv, pixelCPEforDevice::ParamsOnDeviceT const *cpeParams, uint32_t hitsInFit, uint32_t maxNumberOfTuples, diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CACell.h b/RecoTracker/PixelSeeding/plugins/alpaka/CACell.h index a03d9aa5155f7..68841e4bfd9f5 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CACell.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CACell.h @@ -9,12 +9,12 @@ #include -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/VecArray.h" #include "HeterogeneousCore/AlpakaInterface/interface/SimpleVector.h" #include "RecoTracker/PixelSeeding/interface/CircleEq.h" #include "DataFormats/TrackSoA/interface/TrackDefinitions.h" -#include "DataFormats/TrackSoA/interface/TrackLayout.h" +#include "DataFormats/TrackSoA/interface/TracksSoA.h" #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "CAStructures.h" @@ -32,7 +32,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { using CellNeighborsVector = caStructures::CellNeighborsVectorT; using CellTracksVector = caStructures::CellTracksVectorT; - using HitsConstView = TrackingRecHitAlpakaSoAConstView; + using HitsConstView = TrackingRecHitSoAConstView; using hindex_type = typename TrackerTraits::hindex_type; using tindex_type = typename TrackerTraits::tindex_type; static constexpr auto invalidHitId = std::numeric_limits::max(); diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc index 326afdb320721..c16aed2e0b1e8 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtuplet.cc @@ -1,9 +1,9 @@ #include -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" -#include "DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" -#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" +#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" @@ -28,12 +28,12 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class CAHitNtupletAlpaka : public stream::EDProducer<> { - using HitsConstView = TrackingRecHitAlpakaSoAConstView; - using HitsOnDevice = TrackingRecHitAlpakaCollection; + using HitsConstView = TrackingRecHitSoAConstView; + using HitsOnDevice = TrackingRecHitsSoACollection; using HitsOnHost = TrackingRecHitHost; - using TkSoAHost = TrackSoAHost; - using TkSoADevice = TrackSoACollection; + using TkSoAHost = TracksHost; + using TkSoADevice = TracksSoACollection; using Algo = CAHitNtupletGenerator; diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc index c40ffef7c04b1..87d3a871b6e4a 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.cc @@ -10,9 +10,9 @@ #include #include -#include "DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" +#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -294,10 +294,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { } template - TrackSoACollection CAHitNtupletGenerator::makeTuplesAsync( + TracksSoACollection CAHitNtupletGenerator::makeTuplesAsync( HitsOnDevice const& hits_d, ParamsOnDevice const* cpeParams, float bfield, Queue& queue) const { using HelixFit = HelixFit; - using TrackSoA = TrackSoACollection; + using TrackSoA = TracksSoACollection; using GPUKernels = CAHitNtupletGeneratorKernels; TrackSoA tracks(queue); diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.h b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.h index 9adf86a8cc63e..38c71630d8631 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGenerator.h @@ -5,11 +5,11 @@ #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "DataFormats/TrackSoA/interface/TrackDefinitions.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" -#include "DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" -#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" +#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" +#include "DataFormats/TrackingRecHitSoA/interface/alpaka/TrackingRecHitsSoACollection.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h" @@ -26,19 +26,19 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class CAHitNtupletGenerator { public: - using HitsView = TrackingRecHitAlpakaSoAView; - using HitsConstView = TrackingRecHitAlpakaSoAConstView; - using HitsOnDevice = TrackingRecHitAlpakaCollection; + using HitsView = TrackingRecHitSoAView; + using HitsConstView = TrackingRecHitSoAConstView; + using HitsOnDevice = TrackingRecHitsSoACollection; using HitsOnHost = TrackingRecHitHost; - using hindex_type = typename TrackingRecHitAlpakaSoA::hindex_type; + using hindex_type = typename TrackingRecHitSoA::hindex_type; using HitToTuple = caStructures::HitToTupleT; using TupleMultiplicity = caStructures::TupleMultiplicityT; using OuterHitOfCell = caStructures::OuterHitOfCellT; using CACell = CACellT; - using TkSoAHost = TrackSoAHost; - using TkSoADevice = TrackSoACollection; + using TkSoAHost = TracksHost; + using TkSoADevice = TracksSoACollection; using HitContainer = typename TrackSoA::HitContainer; using Tuple = HitContainer; diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.h b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.h index 1b77bafd3320f..d8757b92dfadc 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernels.h @@ -11,8 +11,8 @@ #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" #include "DataFormats/TrackSoA/interface/TrackDefinitions.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/AtomicPairCounter.h" #include "HeterogeneousCore/AlpakaInterface/interface/HistoContainer.h" #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" @@ -210,8 +210,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { using CAParams = caHitNtupletGenerator::CAParamsT; using Counters = caHitNtupletGenerator::Counters; - using HitsView = TrackingRecHitAlpakaSoAView; - using HitsConstView = TrackingRecHitAlpakaSoAConstView; + using HitsView = TrackingRecHitSoAView; + using HitsConstView = TrackingRecHitSoAConstView; using TkSoAView = TrackSoAView; using HitToTuple = caStructures::template HitToTupleT; diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernelsImpl.h b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernelsImpl.h index 5b0638f42ab1b..604a94394e6dc 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernelsImpl.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAHitNtupletGeneratorKernelsImpl.h @@ -15,7 +15,7 @@ #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h" #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "CAStructures.h" #include "CAHitNtupletGeneratorKernels.h" diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h b/RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h index 21687543c60fe..f04260e4f61aa 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/CAPixelDoubletsAlgos.h @@ -10,7 +10,7 @@ #include "HeterogeneousCore/AlpakaInterface/interface/traits.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "HeterogeneousCore/AlpakaInterface/interface/VecArray.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "DataFormats/Math/interface/approx_atan2.h" #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "CAStructures.h" @@ -147,7 +147,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const float minRadius = hardPtCut * 87.78f; const float minRadius2T4 = 4.f * minRadius * minRadius; - using PhiBinner = typename TrackingRecHitAlpakaSoA::PhiBinner; + using PhiBinner = typename TrackingRecHitSoA::PhiBinner; auto const& __restrict__ phiBinner = hh.phiBinner(); uint32_t const* __restrict__ offsets = hh.hitsLayerStart().data(); diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/HelixFit.h b/RecoTracker/PixelSeeding/plugins/alpaka/HelixFit.h index 0a3d4d4a75035..cc678ba65caf2 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/HelixFit.h +++ b/RecoTracker/PixelSeeding/plugins/alpaka/HelixFit.h @@ -3,7 +3,7 @@ #include #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "RecoTracker/PixelTrackFitting/interface/alpaka/FitResult.h" #include "Geometry/CommonTopologies/interface/SimplePixelTopology.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" @@ -48,10 +48,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class HelixFit { public: - using TrackingRecHitSoAs = TrackingRecHitAlpakaSoA; + using TrackingRecHitSoAs = TrackingRecHitSoA; - using HitView = TrackingRecHitAlpakaSoAView; - using HitConstView = TrackingRecHitAlpakaSoAConstView; + using HitView = TrackingRecHitSoAView; + using HitConstView = TrackingRecHitSoAConstView; using Tuples = typename TrackSoA::HitContainer; using OutputSoAView = TrackSoAView; diff --git a/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc b/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc index 236d914bb5544..ca9803955e148 100644 --- a/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc +++ b/RecoTracker/PixelSeeding/plugins/alpaka/RiemannFit.dev.cc @@ -7,7 +7,7 @@ #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" #include "HeterogeneousCore/AlpakaInterface/interface/traits.h" -#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsLayout.h" +#include "DataFormats/TrackingRecHitSoA/interface/TrackingRecHitsSoA.h" #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" #include "RecoLocalTracker/SiPixelRecHits/interface/pixelCPEforDevice.h" #include "RecoTracker/PixelTrackFitting/interface/alpaka/RiemannFit.h" @@ -33,7 +33,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { Tuples const *__restrict__ foundNtuplets, TupleMultiplicity const *__restrict__ tupleMultiplicity, uint32_t nHits, - TrackingRecHitAlpakaSoAConstView hh, + TrackingRecHitSoAConstView hh, pixelCPEforDevice::ParamsOnDeviceT const *__restrict__ cpeParams, double *__restrict__ phits, float *__restrict__ phits_ge, @@ -209,7 +209,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { }; template - void HelixFit::launchRiemannKernels(const TrackingRecHitAlpakaSoAConstView &hv, + void HelixFit::launchRiemannKernels(const TrackingRecHitSoAConstView &hv, pixelCPEforDevice::ParamsOnDeviceT const *cpeParams, uint32_t nhits, uint32_t maxNumberOfTuples, diff --git a/RecoTracker/PixelTrackFitting/interface/alpaka/BrokenLine.h b/RecoTracker/PixelTrackFitting/interface/alpaka/BrokenLine.h index 5dc1fd7d3e445..139cdb081715e 100644 --- a/RecoTracker/PixelTrackFitting/interface/alpaka/BrokenLine.h +++ b/RecoTracker/PixelTrackFitting/interface/alpaka/BrokenLine.h @@ -121,7 +121,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { scalar tempC = -rho * y0 + tempSmallU * cosPhi; scalar tempB = rho * x0 + tempSmallU * sinPhi; scalar tempA = 2. * deltaOrth + rho * (riemannFit::sqr(deltaOrth) + riemannFit::sqr(deltaPara)); - scalar tempU = alpaka::math::sin(acc, 1. + rho * tempA); + scalar tempU = alpaka::math::sqrt(acc, 1. + rho * tempA); // Intermediate computations for the error matrix transform scalar xi = 1. / (riemannFit::sqr(tempB) + riemannFit::sqr(tempC)); diff --git a/RecoTracker/PixelTrackFitting/plugins/PixelTrackDumpAlpaka.cc b/RecoTracker/PixelTrackFitting/plugins/PixelTrackDumpAlpaka.cc index 7524fa012eb31..2b70db60900d3 100644 --- a/RecoTracker/PixelTrackFitting/plugins/PixelTrackDumpAlpaka.cc +++ b/RecoTracker/PixelTrackFitting/plugins/PixelTrackDumpAlpaka.cc @@ -15,13 +15,13 @@ #include "FWCore/Utilities/interface/RunningAverage.h" #include "RecoTracker/TkMSParametrization/interface/PixelRecoUtilities.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" template class PixelTrackDumpAlpakaT : public edm::global::EDAnalyzer<> { public: - using TkSoAHost = TrackSoAHost; + using TkSoAHost = TracksHost; using VertexSoAHost = ZVertexHost; explicit PixelTrackDumpAlpakaT(const edm::ParameterSet& iConfig); diff --git a/RecoTracker/PixelTrackFitting/plugins/PixelTrackProducerFromSoAAlpaka.cc b/RecoTracker/PixelTrackFitting/plugins/PixelTrackProducerFromSoAAlpaka.cc index 8b025683aab5e..2d56db656223f 100644 --- a/RecoTracker/PixelTrackFitting/plugins/PixelTrackProducerFromSoAAlpaka.cc +++ b/RecoTracker/PixelTrackFitting/plugins/PixelTrackProducerFromSoAAlpaka.cc @@ -3,7 +3,7 @@ #include "DataFormats/BeamSpot/interface/BeamSpot.h" #include "DataFormats/GeometrySurface/interface/Plane.h" #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" -#include "DataFormats/TrackSoA/interface/TrackSoAHost.h" +#include "DataFormats/TrackSoA/interface/TracksHost.h" #include "DataFormats/TrackReco/interface/Track.h" #include "DataFormats/TrackReco/interface/TrackExtra.h" #include "DataFormats/TrackReco/interface/TrackFwd.h" @@ -38,7 +38,7 @@ template class PixelTrackProducerFromSoAAlpaka : public edm::global::EDProducer<> { - using TkSoAHost = TrackSoAHost; + using TkSoAHost = TracksHost; using tracksHelpers = TracksUtilities; using HMSstorage = std::vector; diff --git a/RecoTracker/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc b/RecoTracker/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc index c932245d5fdcf..06c895e03cf64 100644 --- a/RecoTracker/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc +++ b/RecoTracker/PixelVertexFinding/plugins/PixelVertexProducerFromSoAAlpaka.cc @@ -1,4 +1,4 @@ -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" #include "DataFormats/BeamSpot/interface/BeamSpot.h" #include "DataFormats/Common/interface/OrphanHandle.h" #include "DataFormats/TrackReco/interface/Track.h" diff --git a/RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceSoAHostAlpaka.h b/RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceSoAHostAlpaka.h index ef1c17834ee19..1978192c36f04 100644 --- a/RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceSoAHostAlpaka.h +++ b/RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceSoAHostAlpaka.h @@ -3,7 +3,7 @@ #include #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "DataFormats/Portable/interface/PortableHostCollection.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h" #include "PixelVertexWorkSpaceLayout.h" template diff --git a/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexProducerAlpaka.cc b/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexProducerAlpaka.cc index 76cbc8eb1bff3..68994112f5cc8 100644 --- a/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexProducerAlpaka.cc +++ b/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexProducerAlpaka.cc @@ -18,10 +18,10 @@ #include "HeterogeneousCore/AlpakaCore/interface/alpaka/EventSetup.h" #include "HeterogeneousCore/AlpakaCore/interface/alpaka/global/EDProducer.h" -#include "DataFormats/TrackSoA/interface/alpaka/TrackSoACollection.h" -#include "DataFormats/TrackSoA/interface/TrackSoADevice.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h" -#include "DataFormats/Vertex/interface/ZVertexSoADevice.h" +#include "DataFormats/TrackSoA/interface/alpaka/TracksSoACollection.h" +#include "DataFormats/TrackSoA/interface/TracksDevice.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h" +#include "DataFormats/VertexSoA/interface/ZVertexDevice.h" #include "HeterogeneousCore/AlpakaCore/interface/alpaka/MakerMacros.h" #include "vertexFinder.h" @@ -34,8 +34,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template class PixelVertexProducerAlpaka : public global::EDProducer<> { - using TkSoADevice = TrackSoACollection; - using GPUAlgo = vertexFinder::Producer; + using TkSoADevice = TracksSoACollection; + using Algo = vertexFinder::Producer; public: explicit PixelVertexProducerAlpaka(const edm::ParameterSet& iConfig); @@ -52,7 +52,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { device::EDGetToken tokenDeviceTrack_; device::EDPutToken tokenDeviceVertex_; - const GPUAlgo gpuAlgo_; + const Algo Algo_; // Tracking cuts before sending tracks to vertex algo const float ptMin_; @@ -61,7 +61,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template PixelVertexProducerAlpaka::PixelVertexProducerAlpaka(const edm::ParameterSet& conf) - : gpuAlgo_(conf.getParameter("oneKernel"), + : Algo_(conf.getParameter("oneKernel"), conf.getParameter("useDensity"), conf.getParameter("useDBSCAN"), conf.getParameter("useIterative"), @@ -105,9 +105,9 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { void PixelVertexProducerAlpaka::produceOnGPU(edm::StreamID streamID, device::Event& iEvent, const device::EventSetup& iSetup) const { - auto const& hTracks = iEvent.get(tokenDeviceTrack_); + auto const& dTracks = iEvent.get(tokenDeviceTrack_); - iEvent.emplace(tokenDeviceVertex_, gpuAlgo_.makeAsync(iEvent.queue(), hTracks.view(), ptMin_, ptMax_)); + iEvent.emplace(tokenDeviceVertex_, Algo_.makeAsync(iEvent.queue(), dTracks.view(), ptMin_, ptMax_)); } template diff --git a/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexWorkSpaceSoADeviceAlpaka.h b/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexWorkSpaceSoADeviceAlpaka.h index b9f23b4bfcd8b..b35adbb2cb207 100644 --- a/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexWorkSpaceSoADeviceAlpaka.h +++ b/RecoTracker/PixelVertexFinding/plugins/alpaka/PixelVertexWorkSpaceSoADeviceAlpaka.h @@ -3,8 +3,8 @@ #include #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h" -#include "DataFormats/Vertex/interface/ZVertexDefinitions.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h" +#include "DataFormats/VertexSoA/interface/ZVertexDefinitions.h" #include "../PixelVertexWorkSpaceLayout.h" namespace ALPAKA_ACCELERATOR_NAMESPACE { diff --git a/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h b/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h index b54f1f3ba5594..3de9c58e9f601 100644 --- a/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h +++ b/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksByDensity.h @@ -5,7 +5,7 @@ #include #include #include -#include "DataFormats/Vertex/interface/ZVertexLayout.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "HeterogeneousCore/AlpakaInterface/interface/HistoContainer.h" #include "../PixelVertexWorkSpaceLayout.h" diff --git a/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h b/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h index f9b0539668b5d..96418a038f5bb 100644 --- a/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h +++ b/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksDBSCAN.h @@ -5,7 +5,7 @@ #include #include #include -#include "DataFormats/Vertex/interface/ZVertexLayout.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "HeterogeneousCore/AlpakaInterface/interface/HistoContainer.h" #include "../PixelVertexWorkSpaceLayout.h" diff --git a/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h b/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h index 21b329c8b71bd..50513e1ff699b 100644 --- a/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h +++ b/RecoTracker/PixelVertexFinding/plugins/alpaka/clusterTracksIterative.h @@ -5,8 +5,8 @@ #include #include #include -#include "DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h" -#include "DataFormats/Vertex/interface/ZVertexDefinitions.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h" +#include "DataFormats/VertexSoA/interface/ZVertexDefinitions.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "HeterogeneousCore/AlpakaInterface/interface/HistoContainer.h" #include "RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceLayout.h" diff --git a/RecoTracker/PixelVertexFinding/plugins/alpaka/sortByPt2.h b/RecoTracker/PixelVertexFinding/plugins/alpaka/sortByPt2.h index 8ce44a2f49591..8bc4b3519b86a 100644 --- a/RecoTracker/PixelVertexFinding/plugins/alpaka/sortByPt2.h +++ b/RecoTracker/PixelVertexFinding/plugins/alpaka/sortByPt2.h @@ -9,7 +9,7 @@ #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "HeterogeneousCore/AlpakaInterface/interface/HistoContainer.h" #include "HeterogeneousCore/AlpakaInterface/interface/radixSort.h" -#include "DataFormats/Vertex/interface/ZVertexLayout.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" #include "RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceLayout.h" #include "vertexFinder.h" diff --git a/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc b/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc index 3832a1af75590..38a64b80fb781 100644 --- a/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc +++ b/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.dev.cc @@ -1,6 +1,6 @@ #include #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h" #include "HeterogeneousCore/AlpakaInterface/interface/workdivision.h" #include "HeterogeneousCore/AlpakaInterface/interface/traits.h" #include "PixelVertexWorkSpaceUtilitiesAlpaka.h" diff --git a/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.h b/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.h index aa54c9c373a49..bfbf117c16a8c 100644 --- a/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.h +++ b/RecoTracker/PixelVertexFinding/plugins/alpaka/vertexFinder.h @@ -5,11 +5,11 @@ #include #include #include "DataFormats/TrackSoA/interface/alpaka/TrackUtilities.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" -#include "DataFormats/Vertex/interface/ZVertexLayout.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h" -#include "DataFormats/Vertex/interface/ZVertexSoADevice.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" +#include "DataFormats/VertexSoA/interface/ZVertexSoA.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h" +#include "DataFormats/VertexSoA/interface/ZVertexDevice.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h" #include "../PixelVertexWorkSpaceLayout.h" #include "PixelVertexWorkSpaceUtilitiesAlpaka.h" #include "PixelVertexWorkSpaceSoADeviceAlpaka.h" diff --git a/RecoTracker/PixelVertexFinding/test/alpaka/VertexFinder_t.cc b/RecoTracker/PixelVertexFinding/test/alpaka/VertexFinder_t.cc index d039d24878947..2defce6c89719 100644 --- a/RecoTracker/PixelVertexFinding/test/alpaka/VertexFinder_t.cc +++ b/RecoTracker/PixelVertexFinding/test/alpaka/VertexFinder_t.cc @@ -4,10 +4,10 @@ #include "HeterogeneousCore/AlpakaInterface/interface/memory.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexUtilities.h" -#include "DataFormats/Vertex/interface/ZVertexSoAHost.h" -#include "DataFormats/Vertex/interface/alpaka/ZVertexSoACollection.h" -#include "DataFormats/Vertex/interface/ZVertexSoADevice.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexUtilities.h" +#include "DataFormats/VertexSoA/interface/ZVertexHost.h" +#include "DataFormats/VertexSoA/interface/alpaka/ZVertexSoACollection.h" +#include "DataFormats/VertexSoA/interface/ZVertexDevice.h" #include "RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceLayout.h" #include "RecoTracker/PixelVertexFinding/plugins/PixelVertexWorkSpaceSoAHostAlpaka.h"