From ae0ca26433f6907be8f27f9fa1465a3546fa506f Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Wed, 28 Jun 2023 17:44:29 +0200 Subject: [PATCH 1/3] Rename SiPixelClustersSoA to SiPixelClustersCollection --- .../interface/alpaka/SiPixelClustersCollection.h | 16 ++++++++-------- .../src/alpaka/classes_cuda_def.xml | 8 ++++---- .../src/alpaka/classes_rocm_def.xml | 4 ++-- .../test/alpaka/Clusters_test.cc | 2 +- .../plugins/alpaka/SiPixelPhase2DigiToCluster.cc | 4 ++-- .../plugins/alpaka/SiPixelRawToCluster.cc | 4 ++-- .../alpaka/SiPixelRawToClusterKernel.dev.cc | 4 ++-- .../plugins/alpaka/SiPixelRawToClusterKernel.h | 4 ++-- .../plugins/alpaka/PixelRecHitGPUKernel.dev.cc | 2 +- .../plugins/alpaka/PixelRecHitGPUKernel.h | 2 +- .../plugins/alpaka/SiPixelRecHitAlpaka.cc | 2 +- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h b/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h index 5dd9b677f7b11..76bf3261d69fe 100644 --- a/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h +++ b/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h @@ -2,13 +2,15 @@ #define DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersCollection_h #include + #include -#include "HeterogeneousCore/AlpakaInterface/interface/config.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" + #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" +#include "HeterogeneousCore/AlpakaInterface/interface/config.h" // TODO: The class is created via inheritance of the PortableCollection. // This is generally discouraged, and should be done via composition. @@ -18,16 +20,14 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { using SiPixelClustersCollection = SiPixelClustersHost; #else using SiPixelClustersCollection = SiPixelClustersDevice; - #endif - using SiPixelClustersSoA = SiPixelClustersCollection; } // namespace ALPAKA_ACCELERATOR_NAMESPACE namespace cms::alpakatools { template <> - struct CopyToHost { + struct CopyToHost { template - static auto copyAsync(TQueue &queue, ALPAKA_ACCELERATOR_NAMESPACE::SiPixelClustersSoA const &srcData) { + static auto copyAsync(TQueue &queue, ALPAKA_ACCELERATOR_NAMESPACE::SiPixelClustersCollection const &srcData) { SiPixelClustersHost dstData(srcData->metadata().size(), queue); alpaka::memcpy(queue, dstData.buffer(), srcData.buffer()); dstData.setNClusters(srcData.nClusters(), srcData.offsetBPIX2()); @@ -36,4 +36,4 @@ namespace cms::alpakatools { }; } // namespace cms::alpakatools -#endif // DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersCollection_h \ No newline at end of file +#endif // DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersCollection_h diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml index 52467aaa7a21d..461ee84e20ae1 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml @@ -3,12 +3,12 @@ --> - diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml index 74d4957ecac3f..8194ac04f3eae 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml @@ -1,4 +1,4 @@ - - + + \ No newline at end of file diff --git a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc index fe59647777c4e..8d8139bc40508 100644 --- a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc +++ b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc @@ -30,7 +30,7 @@ int main() { { // Instantiate tracks on device. PortableDeviceCollection allocates // SoA on device automatically. - SiPixelClustersSoA clusters_d(100, queue); + SiPixelClustersCollection clusters_d(100, queue); testClusterSoA::runKernels(clusters_d.view(), queue); // Instantate tracks on host. This is where the data will be diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelPhase2DigiToCluster.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelPhase2DigiToCluster.cc index b4dde2eefd575..6c7bc386e0a9e 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelPhase2DigiToCluster.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelPhase2DigiToCluster.cc @@ -68,7 +68,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { device::EDPutToken digiPutToken_; device::EDPutToken digiErrorPutToken_; - device::EDPutToken clusterPutToken_; + device::EDPutToken clusterPutToken_; pixelDetails::SiPixelRawToClusterKernel Algo_; @@ -148,7 +148,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { void SiPixelPhase2DigiToCluster::produce(device::Event& iEvent, device::EventSetup const& iSetup) { if (nDigis_ == 0) { - SiPixelClustersSoA clusters_d = SiPixelClustersSoA(pixelTopology::Phase1::numberOfModules, iEvent.queue()); + SiPixelClustersCollection clusters_d{pixelTopology::Phase1::numberOfModules, iEvent.queue()}; iEvent.emplace(digiPutToken_, std::move(digis_d)); iEvent.emplace(clusterPutToken_, std::move(clusters_d)); if (includeErrors_) { diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToCluster.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToCluster.cc index 12556b43de009..e6ca3a97fedf1 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToCluster.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToCluster.cc @@ -75,7 +75,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { edm::EDPutTokenT fmtErrorToken_; device::EDPutToken digiPutToken_; device::EDPutToken digiErrorPutToken_; - device::EDPutToken clusterPutToken_; + device::EDPutToken clusterPutToken_; edm::ESWatcher recordWatcher_; const device::ESGetToken mapToken_; @@ -283,7 +283,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // are no valid pointers to clusters' Collection columns, instantiation // of TrackingRecHits fail. Example: workflow 11604.0 SiPixelDigisSoA digis_d = SiPixelDigisSoA(nDigis_, iEvent.queue()); - SiPixelClustersSoA clusters_d = SiPixelClustersSoA(pixelTopology::Phase1::numberOfModules, iEvent.queue()); + SiPixelClustersCollection clusters_d{pixelTopology::Phase1::numberOfModules, iEvent.queue()}; iEvent.emplace(digiPutToken_, std::move(digis_d)); iEvent.emplace(clusterPutToken_, std::move(clusters_d)); if (includeErrors_) { diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc index dfee404d9a800..53ce16205ce84 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc @@ -747,7 +747,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // std::cout << errors.begin()->first << " - " << (errors.begin()->second).size() << std::endl; digiErrors_d = SiPixelDigiErrorsSoA(wordCounter, queue); // std::move(errors), queue); } - clusters_d = SiPixelClustersSoA(numberOfModules, queue); + clusters_d = SiPixelClustersCollection(numberOfModules, queue); if (wordCounter) // protect in case of empty event.... { #if defined(ALPAKA_ACC_GPU_CUDA_ASYNC_BACKEND) || defined(ALPAKA_ACC_GPU_HIP_ASYNC_BACKEND) @@ -911,7 +911,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // alpaka::memcpy(queue, digis_d->view(), digis_h_view); - clusters_d = SiPixelClustersSoA(numberOfModules, queue); + clusters_d = SiPixelClustersCollection(numberOfModules, queue); // nModules_Clusters_h = cms::cuda::make_host_unique(2, stream); diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.h index 5f5f29dc1bbd1..c48b64f27f5b3 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.h @@ -179,7 +179,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { return std::move(*digis_d); } - SiPixelClustersSoA&& getClusters() { + SiPixelClustersCollection&& getClusters() { clusters_d->setNClusters(nModules_Clusters_h[1], nModules_Clusters_h[2]); return std::move(*clusters_d); } @@ -192,7 +192,7 @@ 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 clusters_d; std::optional digiErrors_d; }; diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.dev.cc b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.dev.cc index 1ec2435d9dec1..0df0b43fc35d4 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.dev.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.dev.cc @@ -49,7 +49,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template TrackingRecHitAlpakaCollection PixelRecHitGPUKernel::makeHitsAsync( SiPixelDigisSoA const& digis_d, - SiPixelClustersSoA const& clusters_d, + SiPixelClustersCollection const& clusters_d, BeamSpotPOD const* bs_d, pixelCPEforDevice::ParamsOnDeviceT const* cpeParams, Queue queue) const { diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.h b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.h index 80dcf7a13ec30..eb6ee89771cfa 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.h +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/PixelRecHitGPUKernel.h @@ -34,7 +34,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { using ParamsOnGPU = pixelCPEforDevice::ParamsOnDeviceT; TrackingRecHitAlpakaCollection makeHitsAsync(SiPixelDigisSoA const& digis_d, - SiPixelClustersSoA const& clusters_d, + SiPixelClustersCollection const& clusters_d, BeamSpotPOD const* bs_d, ParamsOnGPU const* cpeParams, Queue queue) const; diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitAlpaka.cc b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitAlpaka.cc index b5749c83b0c8b..0b8d8f9deddab 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitAlpaka.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/SiPixelRecHitAlpaka.cc @@ -49,7 +49,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { const device::ESGetToken, PixelCPEFastParamsRecord> cpeToken_; const device::EDGetToken tBeamSpot; - const device::EDGetToken tokenClusters_; + const device::EDGetToken tokenClusters_; const device::EDGetToken tokenDigi_; const device::EDPutToken> tokenHit_; From d90d78f50e53ce71f414b31bf420bec582724ae6 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Wed, 28 Jun 2023 17:51:50 +0200 Subject: [PATCH 2/3] Rename SiPixelClustersLayoutSoA to SiPixelClustersSoA Use SiPixelClustersSoA everywhere instead of SiPixelClustersLayout<>. --- .../interface/SiPixelClustersDevice.h | 10 +++++----- .../interface/SiPixelClustersHost.h | 9 ++++----- ...iPixelClustersLayout.h => SiPixelClustersSoA.h} | 6 +++--- .../interface/alpaka/SiPixelClustersCollection.h | 2 +- .../SiPixelClusterSoA/src/alpaka/classes_cuda.h | 4 ++-- .../src/alpaka/classes_cuda_def.xml | 2 +- .../SiPixelClusterSoA/src/alpaka/classes_rocm.h | 4 ++-- DataFormats/SiPixelClusterSoA/src/classes.h | 4 ++-- DataFormats/SiPixelClusterSoA/src/classes_def.xml | 14 +++++++------- .../SiPixelClusterSoA/test/alpaka/Clusters_test.cc | 4 ++-- .../test/alpaka/Clusters_test.dev.cc | 6 +++--- .../SiPixelClusterizer/plugins/alpaka/CalibPixel.h | 6 +++--- .../plugins/alpaka/ClusterChargeCut.h | 6 +++--- .../plugins/alpaka/PixelClustering.h | 4 ++-- .../alpaka/SiPixelRawToClusterKernel.dev.cc | 4 ++-- .../SiPixelRecHits/plugins/alpaka/pixelRecHits.h | 2 +- 16 files changed, 43 insertions(+), 44 deletions(-) rename DataFormats/SiPixelClusterSoA/interface/{SiPixelClustersLayout.h => SiPixelClustersSoA.h} (71%) diff --git a/DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h b/DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h index 7e2fb4ec2cb2f..c3dac66daf05e 100644 --- a/DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h +++ b/DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h @@ -6,22 +6,22 @@ #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" #include "DataFormats/Portable/interface/PortableDeviceCollection.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" template -class SiPixelClustersDevice : public PortableDeviceCollection, TDev> { +class SiPixelClustersDevice : public PortableDeviceCollection { public: SiPixelClustersDevice() = default; ~SiPixelClustersDevice() = default; template explicit SiPixelClustersDevice(size_t maxModules, TQueue queue) - : PortableDeviceCollection, TDev>(maxModules + 1, queue) {} + : PortableDeviceCollection(maxModules + 1, queue) {} // Constructor which specifies the SoA size explicit SiPixelClustersDevice(size_t maxModules, TDev const &device) - : PortableDeviceCollection, TDev>(maxModules + 1, device) {} + : PortableDeviceCollection(maxModules + 1, device) {} SiPixelClustersDevice(SiPixelClustersDevice &&) = default; SiPixelClustersDevice &operator=(SiPixelClustersDevice &&) = default; @@ -39,4 +39,4 @@ class SiPixelClustersDevice : public PortableDeviceCollection #include "HeterogeneousCore/AlpakaInterface/interface/config.h" #include "DataFormats/Portable/interface/PortableHostCollection.h" - -#include "SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.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 -class SiPixelClustersHost : public PortableHostCollection> { +class SiPixelClustersHost : public PortableHostCollection { public: SiPixelClustersHost() = default; ~SiPixelClustersHost() = default; template explicit SiPixelClustersHost(size_t maxModules, TQueue queue) - : PortableHostCollection>(maxModules + 1, queue) {} + : PortableHostCollection(maxModules + 1, queue) {} SiPixelClustersHost(SiPixelClustersHost &&) = default; SiPixelClustersHost &operator=(SiPixelClustersHost &&) = default; @@ -35,4 +34,4 @@ class SiPixelClustersHost : public PortableHostCollection; -using SiPixelClustersLayoutSoAView = SiPixelClustersLayout<>::View; -using SiPixelClustersLayoutSoAConstView = SiPixelClustersLayout<>::ConstView; +using SiPixelClustersSoA = SiPixelClustersLayout<>; +using SiPixelClustersSoAView = SiPixelClustersSoA::View; +using SiPixelClustersSoAConstView = SiPixelClustersSoA::ConstView; #endif // DataFormats_SiPixelClusterSoA_SiPixelClustersLayout_h diff --git a/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h b/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h index 76bf3261d69fe..7b142ffd11296 100644 --- a/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h +++ b/DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h @@ -8,7 +8,7 @@ #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h index 1e874e0bd862d..f93e2fce7a8b6 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h @@ -3,9 +3,9 @@ #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/DeviceProduct.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" -#endif // DataFormats_SiPixelClusterSoA_Alpaka_Classes_CUDA_h \ No newline at end of file +#endif // DataFormats_SiPixelClusterSoA_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 461ee84e20ae1..fa6b3e155ed17 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml @@ -10,7 +10,7 @@ --> - + diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h index 7b3b28ac2a6a5..97a477d8ced4c 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h @@ -3,8 +3,8 @@ #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/DeviceProduct.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" -#endif // DataFormats_SiPixelClusterSoA_Alpaka_Classes_rocm_h \ No newline at end of file +#endif // DataFormats_SiPixelClusterSoA_Alpaka_Classes_rocm_h diff --git a/DataFormats/SiPixelClusterSoA/src/classes.h b/DataFormats/SiPixelClusterSoA/src/classes.h index 2ce3eeda7f8ba..5d98d6b38a397 100644 --- a/DataFormats/SiPixelClusterSoA/src/classes.h +++ b/DataFormats/SiPixelClusterSoA/src/classes.h @@ -2,7 +2,7 @@ #define DataFormats_SiPixelClusterSoA_src_classes_h #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" -#endif // DataFormats_SiPixelClusterSoA_src_classes_h \ No newline at end of file +#endif // DataFormats_SiPixelClusterSoA_src_classes_h diff --git a/DataFormats/SiPixelClusterSoA/src/classes_def.xml b/DataFormats/SiPixelClusterSoA/src/classes_def.xml index dfda5040bb5c5..d0cb1d882fa86 100644 --- a/DataFormats/SiPixelClusterSoA/src/classes_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/classes_def.xml @@ -1,16 +1,16 @@ - - - + + + ::ROOTReadStreamer(newObj, onfile.layout_); + PortableHostCollection::ROOTReadStreamer(newObj, onfile.layout_); ]]> diff --git a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc index 8d8139bc40508..0c8634b835108 100644 --- a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc +++ b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.cc @@ -4,7 +4,7 @@ #include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "HeterogeneousCore/AlpakaInterface/interface/devices.h" #include "HeterogeneousCore/AlpakaInterface/interface/host.h" @@ -17,7 +17,7 @@ using namespace ALPAKA_ACCELERATOR_NAMESPACE; namespace ALPAKA_ACCELERATOR_NAMESPACE { namespace testClusterSoA { - void runKernels(SiPixelClustersLayoutSoAView clust_view, Queue& queue); + void runKernels(SiPixelClustersSoAView clust_view, Queue& queue); } } // namespace ALPAKA_ACCELERATOR_NAMESPACE diff --git a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.dev.cc b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.dev.cc index 1f4cb4cc5b6f5..dd903f3eec759 100644 --- a/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.dev.cc +++ b/DataFormats/SiPixelClusterSoA/test/alpaka/Clusters_test.dev.cc @@ -14,7 +14,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { class TestFillKernel { public: template >> - ALPAKA_FN_ACC void operator()(TAcc const& acc, SiPixelClustersLayoutSoAView clust_view) const { + ALPAKA_FN_ACC void operator()(TAcc const& acc, SiPixelClustersSoAView clust_view) const { for (int32_t j : elements_with_stride(acc, clust_view.metadata().size())) { clust_view[j].moduleStart() = j; clust_view[j].clusInModule() = j * 2; @@ -27,7 +27,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { class TestVerifyKernel { public: template >> - ALPAKA_FN_ACC void operator()(TAcc const& acc, SiPixelClustersLayoutSoAConstView clust_view) const { + ALPAKA_FN_ACC void operator()(TAcc const& acc, SiPixelClustersSoAConstView clust_view) const { for (uint32_t j : elements_with_stride(acc, clust_view.metadata().size())) { assert(clust_view[j].moduleStart() == j); assert(clust_view[j].clusInModule() == j * 2); @@ -37,7 +37,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { } }; - void runKernels(SiPixelClustersLayoutSoAView clust_view, Queue& queue) { + void runKernels(SiPixelClustersSoAView clust_view, Queue& queue) { uint32_t items = 64; uint32_t groups = divide_up_by(clust_view.metadata().size(), items); auto workDiv = make_workdiv(groups, items); diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/CalibPixel.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/CalibPixel.h index c04f211444f17..252a82a876047 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/CalibPixel.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/CalibPixel.h @@ -11,7 +11,7 @@ #include "CondFormats/SiPixelObjects/interface/alpaka/SiPixelGainCalibrationForHLTDevice.h" #include "CondFormats/SiPixelObjects/interface/alpaka/SiPixelGainCalibrationForHLTUtilities.h" #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigiErrorsLayout.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisLayout.h" #include "HeterogeneousCore/AlpakaInterface/interface/config.h" @@ -42,7 +42,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { ALPAKA_FN_ACC void operator()(const TAcc& acc, bool isRun2, SiPixelDigisLayoutSoAView view, - SiPixelClustersLayoutSoAView clus_view, + SiPixelClustersSoAView clus_view, const SiPixelGainCalibrationForHLTSoAConstView gains, int numElements) const { const uint32_t threadIdxGlobal(alpaka::getIdx(acc)[0u]); @@ -93,7 +93,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // template // ALPAKA_FN_ACC void operator()(const TAcc& acc, // SiPixelDigisLayoutSoAView& view, - // SiPixelClustersLayoutSoAView& clus_view, + // SiPixelClustersSoAView& clus_view, // int numElements // ) const { // const uint32_t threadIdxGlobal(alpaka::getIdx(acc)[0u]); diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/ClusterChargeCut.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/ClusterChargeCut.h index 63ef3bb3c1633..27f8196f53909 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/ClusterChargeCut.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/ClusterChargeCut.h @@ -8,7 +8,7 @@ #include "HeterogeneousCore/AlpakaInterface/interface/prefixScan.h" #include "DataFormats/SiPixelClusterSoA/interface/ClusteringConstants.h" #include "RecoLocalTracker/SiPixelClusterizer/plugins/SiPixelClusterThresholds.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersLayout.h" +#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelDigiSoA/interface/SiPixelDigisLayout.h" // namespace ALPAKA_ACCELERATOR_NAMESPACE { @@ -20,7 +20,7 @@ namespace pixelClustering { ALPAKA_FN_ACC void operator()( const TAcc& acc, SiPixelDigisLayoutSoAView digi_view, - SiPixelClustersLayoutSoAView clus_view, + SiPixelClustersSoAView clus_view, SiPixelClusterThresholds clusterThresholds, // charge cut on cluster in electrons (for layer 1 and for other layers) const uint32_t numElements) const { @@ -178,4 +178,4 @@ namespace pixelClustering { } // namespace pixelClustering -#endif // \ No newline at end of file +#endif // diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h index a5c8ace5b79b4..6d08bc41540a2 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/PixelClustering.h @@ -88,7 +88,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template ALPAKA_FN_ACC void operator()(const TAcc& acc, SiPixelDigisLayoutSoAView digi_view, - SiPixelClustersLayoutSoAView clus_view, + SiPixelClustersSoAView clus_view, const unsigned int numElements) const { [[maybe_unused]] constexpr int nMaxModules = TrackerTraits::numberOfModules; @@ -115,7 +115,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { template ALPAKA_FN_ACC void operator()(const TAcc& acc, SiPixelDigisLayoutSoAView digi_view, - SiPixelClustersLayoutSoAView clus_view, + SiPixelClustersSoAView clus_view, const unsigned int numElements) const { const uint32_t blockIdx(alpaka::getIdx(acc)[0u]); if (blockIdx >= clus_view[0].moduleStart()) diff --git a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc index 53ce16205ce84..0cd0f0ddb030a 100644 --- a/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc +++ b/RecoLocalTracker/SiPixelClusterizer/plugins/alpaka/SiPixelRawToClusterKernel.dev.cc @@ -508,7 +508,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { // template // ALPAKA_FN_ACC void operator()(const TAcc &acc, // // uint32_t const *__restrict__ cluStart, -// SiPixelClustersLayoutSoAView clus_view +// SiPixelClustersSoAView clus_view // // uint32_t *__restrict__ moduleStart // ) const { // ALPAKA_ASSERT_OFFLOAD(TrackerTraits::numberOfModules < 2048); // easy to extend at least till 32*1024 @@ -595,7 +595,7 @@ namespace pixelDetails { template ALPAKA_FN_ACC void operator()(const TAcc &acc, // uint32_t const *__restrict__ cluStart, - SiPixelClustersLayoutSoAView clus_view) const { + SiPixelClustersSoAView clus_view) const { // uint32_t *__restrict__ moduleStart) const { ALPAKA_ASSERT_OFFLOAD(TrackerTraits::numberOfModules < 2048); // easy to extend at least till 32*1024 diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/pixelRecHits.h b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/pixelRecHits.h index e5c1a387c4bf3..cdb7705efe447 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/pixelRecHits.h +++ b/RecoLocalTracker/SiPixelRecHits/plugins/alpaka/pixelRecHits.h @@ -32,7 +32,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE { BeamSpotPOD const* __restrict__ bs, SiPixelDigisLayoutSoAConstView digis, uint32_t numElements, - SiPixelClustersLayoutSoAConstView clusters, + SiPixelClustersSoAConstView clusters, TrackingRecHitAlpakaSoAView hits) const { // FIXME // the compiler seems NOT to optimize loads from views (even in a simple test case) From cc855ee8dac70a1fdef10f567352c5a9d4ccff38 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Thu, 29 Jun 2023 07:47:00 +0200 Subject: [PATCH 3/3] Update SiPixelClusterSoA dictionaries --- .../SiPixelClusterSoA/src/alpaka/classes_cuda.h | 9 +++------ .../src/alpaka/classes_cuda_def.xml | 15 ++------------- .../SiPixelClusterSoA/src/alpaka/classes_rocm.h | 8 +++----- .../src/alpaka/classes_rocm_def.xml | 6 ++++-- DataFormats/SiPixelClusterSoA/src/classes.h | 1 - DataFormats/SiPixelClusterSoA/src/classes_def.xml | 2 +- 6 files changed, 13 insertions(+), 28 deletions(-) diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h index f93e2fce7a8b6..ee177cb60b93c 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda.h @@ -1,11 +1,8 @@ -#ifndef DataFormats_SiPixelClusterSoA_Alpaka_Classes_CUDA_h -#define DataFormats_SiPixelClusterSoA_Alpaka_Classes_CUDA_h +#ifndef DataFormats_SiPixelClusterSoA_src_alpaka_classes_cuda_h +#define DataFormats_SiPixelClusterSoA_src_alpaka_classes_cuda_h #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/DeviceProduct.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" -#endif // DataFormats_SiPixelClusterSoA_Alpaka_Classes_CUDA_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 fa6b3e155ed17..529b72d3fe830 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_cuda_def.xml @@ -1,17 +1,6 @@ - - - - - - - diff --git a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h index 97a477d8ced4c..187fc15f7012f 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm.h @@ -1,10 +1,8 @@ -#ifndef DataFormats_SiPixelClusterSoA_Alpaka_Classes_rocm_h -#define DataFormats_SiPixelClusterSoA_Alpaka_Classes_rocm_h +#ifndef DataFormats_SiPixelClusterSoA_src_alpaka_classes_rocm_h +#define DataFormats_SiPixelClusterSoA_src_alpaka_classes_rocm_h #include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/DeviceProduct.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelClusterSoA/interface/alpaka/SiPixelClustersCollection.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersDevice.h" -#endif // DataFormats_SiPixelClusterSoA_Alpaka_Classes_rocm_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 8194ac04f3eae..a8d914519f51d 100644 --- a/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/alpaka/classes_rocm_def.xml @@ -1,4 +1,6 @@ + - - \ No newline at end of file + + + diff --git a/DataFormats/SiPixelClusterSoA/src/classes.h b/DataFormats/SiPixelClusterSoA/src/classes.h index 5d98d6b38a397..8514c7732375b 100644 --- a/DataFormats/SiPixelClusterSoA/src/classes.h +++ b/DataFormats/SiPixelClusterSoA/src/classes.h @@ -2,7 +2,6 @@ #define DataFormats_SiPixelClusterSoA_src_classes_h #include "DataFormats/Common/interface/Wrapper.h" -#include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h" #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersHost.h" #endif // DataFormats_SiPixelClusterSoA_src_classes_h diff --git a/DataFormats/SiPixelClusterSoA/src/classes_def.xml b/DataFormats/SiPixelClusterSoA/src/classes_def.xml index d0cb1d882fa86..57c7e7df2d83a 100644 --- a/DataFormats/SiPixelClusterSoA/src/classes_def.xml +++ b/DataFormats/SiPixelClusterSoA/src/classes_def.xml @@ -16,4 +16,4 @@ - \ No newline at end of file +