From 94ba72efcc660f22d82db351eb31054459471492 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Thu, 19 Jan 2023 06:02:58 +0100 Subject: [PATCH] Make type aliases more consistent Use consistently "OnHost" and "OnDevice" instead of "OnCPU" and "OnGPU" --- .../plugins/SiPixelRecHitFromCUDA.cc | 12 +++++----- .../PixelTriplets/plugins/CAHitNtupletCUDA.cc | 18 +++++++-------- .../plugins/CAHitNtupletGeneratorOnGPU.cc | 14 +++++------- .../plugins/CAHitNtupletGeneratorOnGPU.h | 22 ++++++++----------- 4 files changed, 29 insertions(+), 37 deletions(-) diff --git a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc index c639d5cc4fefa..56d8859629d77 100644 --- a/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc +++ b/RecoLocalTracker/SiPixelRecHits/plugins/SiPixelRecHitFromCUDA.cc @@ -33,7 +33,7 @@ class SiPixelRecHitFromCUDAT : public edm::stream::EDProducer static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); using HMSstorage = HostProduct; - using HitsOnGPU = TrackingRecHitSoADevice; + using HitsOnDevice = TrackingRecHitSoADevice; private: void acquire(edm::Event const& iEvent, @@ -42,9 +42,9 @@ class SiPixelRecHitFromCUDAT : public edm::stream::EDProducer void produce(edm::Event& iEvent, edm::EventSetup const& iSetup) override; const edm::ESGetToken geomToken_; - const edm::EDGetTokenT> hitsToken_; // CUDA hits - const edm::EDGetTokenT clusterToken_; // legacy clusters - const edm::EDPutTokenT rechitsPutToken_; // legacy rechits + const edm::EDGetTokenT> hitsToken_; // CUDA hits + const edm::EDGetTokenT clusterToken_; // legacy clusters + const edm::EDPutTokenT rechitsPutToken_; // legacy rechits const edm::EDPutTokenT hostPutToken_; uint32_t nHits_; @@ -55,7 +55,7 @@ class SiPixelRecHitFromCUDAT : public edm::stream::EDProducer template SiPixelRecHitFromCUDAT::SiPixelRecHitFromCUDAT(const edm::ParameterSet& iConfig) : geomToken_(esConsumes()), - hitsToken_(consumes>(iConfig.getParameter("pixelRecHitSrc"))), + hitsToken_(consumes>(iConfig.getParameter("pixelRecHitSrc"))), clusterToken_(consumes(iConfig.getParameter("src"))), rechitsPutToken_(produces()), hostPutToken_(produces()) {} @@ -73,7 +73,7 @@ template void SiPixelRecHitFromCUDAT::acquire(edm::Event const& iEvent, edm::EventSetup const& iSetup, edm::WaitingTaskWithArenaHolder waitingTaskHolder) { - cms::cuda::Product const& inputDataWrapped = iEvent.get(hitsToken_); + cms::cuda::Product const& inputDataWrapped = iEvent.get(hitsToken_); cms::cuda::ScopedContextAcquire ctx{inputDataWrapped, std::move(waitingTaskHolder)}; diff --git a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletCUDA.cc b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletCUDA.cc index 122f4af710966..9fc79e864b176 100644 --- a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletCUDA.cc +++ b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletCUDA.cc @@ -1,35 +1,33 @@ #include #include "CUDADataFormats/Common/interface/Product.h" +#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h" +#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h" #include "DataFormats/Common/interface/Handle.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" #include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/Framework/interface/global/EDProducer.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/ParameterSet/interface/ParameterSetDescription.h" -#include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/PluginManager/interface/ModuleDef.h" #include "FWCore/Utilities/interface/EDGetToken.h" +#include "FWCore/Utilities/interface/InputTag.h" #include "FWCore/Utilities/interface/RunningAverage.h" #include "HeterogeneousCore/CUDACore/interface/ScopedContext.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" - #include "RecoTracker/TkMSParametrization/interface/PixelRecoUtilities.h" #include "CAHitNtupletGeneratorOnGPU.h" -#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h" -#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h" - template class CAHitNtupletCUDAT : public edm::global::EDProducer<> { using HitsConstView = TrackingRecHitSoAConstView; - using HitsOnGPU = TrackingRecHitSoADevice; //TODO move to OnDevice - using HitsOnCPU = TrackingRecHitSoAHost; //TODO move to OnHost + using HitsOnDevice = TrackingRecHitSoADevice; + using HitsOnHost = TrackingRecHitSoAHost; using TrackSoAHost = TrackSoAHeterogeneousHost; using TrackSoADevice = TrackSoAHeterogeneousDevice; @@ -51,9 +49,9 @@ class CAHitNtupletCUDAT : public edm::global::EDProducer<> { bool onGPU_; edm::ESGetToken tokenField_; - edm::EDGetTokenT> tokenHitGPU_; + edm::EDGetTokenT> tokenHitGPU_; edm::EDPutTokenT> tokenTrackGPU_; - edm::EDGetTokenT tokenHitCPU_; + edm::EDGetTokenT tokenHitCPU_; edm::EDPutTokenT tokenTrackCPU_; GPUAlgo gpuAlgo_; diff --git a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorOnGPU.cc b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorOnGPU.cc index f499a6c90d384..97530a9567e22 100644 --- a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorOnGPU.cc +++ b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorOnGPU.cc @@ -10,6 +10,10 @@ #include #include +#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h" +#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h" +#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h" +#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h" #include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Event.h" @@ -21,12 +25,6 @@ #include "HeterogeneousCore/CUDAServices/interface/CUDAService.h" #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h" -#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h" -#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h" - -#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h" -#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h" - #include "CAHitNtupletGeneratorOnGPU.h" namespace { @@ -281,7 +279,7 @@ void CAHitNtupletGeneratorOnGPU::endJob() { template TrackSoAHeterogeneousDevice CAHitNtupletGeneratorOnGPU::makeTuplesAsync( - HitsOnGPU const& hits_d, float bfield, cudaStream_t stream) const { + HitsOnDevice const& hits_d, float bfield, cudaStream_t stream) const { using HelixFitOnGPU = HelixFitOnGPU; using TrackSoA = TrackSoAHeterogeneousDevice; using GPUKernels = CAHitNtupletGeneratorKernelsGPU; @@ -314,7 +312,7 @@ TrackSoAHeterogeneousDevice CAHitNtupletGeneratorOnGPU -TrackSoAHeterogeneousHost CAHitNtupletGeneratorOnGPU::makeTuples(HitsOnCPU const& hits_h, +TrackSoAHeterogeneousHost CAHitNtupletGeneratorOnGPU::makeTuples(HitsOnHost const& hits_h, float bfield) const { using HelixFitOnGPU = HelixFitOnGPU; using TrackSoA = TrackSoAHeterogeneousHost; diff --git a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorOnGPU.h b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorOnGPU.h index 8ee65736541f3..779ffe47488ea 100644 --- a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorOnGPU.h +++ b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletGeneratorOnGPU.h @@ -2,24 +2,20 @@ #define RecoPixelVertexing_PixelTriplets_plugins_CAHitNtupletGeneratorOnGPU_h #include -// #include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHit2DHeterogeneous.h" -// #include "CUDADataFormats/Track/interface/PixelTrackHeterogeneous.h" -#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h" -#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h" -#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h" -#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h" +#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousDevice.h" +#include "CUDADataFormats/Track/interface/TrackSoAHeterogeneousHost.h" #include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoADevice.h" - +#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitSoAHost.h" +#include "CUDADataFormats/TrackingRecHit/interface/TrackingRecHitsUtilities.h" #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "FWCore/Utilities/interface/EDGetToken.h" #include "HeterogeneousCore/CUDAUtilities/interface/SimpleVector.h" #include "CAHitNtupletGeneratorKernels.h" -#include "HelixFitOnGPU.h" - #include "GPUCACell.h" +#include "HelixFitOnGPU.h" namespace edm { class Event; @@ -32,8 +28,8 @@ class CAHitNtupletGeneratorOnGPU { public: using HitsView = TrackingRecHitSoAView; using HitsConstView = TrackingRecHitSoAConstView; - using HitsOnGPU = TrackingRecHitSoADevice; //TODO move to OnDevice - using HitsOnCPU = TrackingRecHitSoAHost; //TODO move to OnHost + using HitsOnDevice = TrackingRecHitSoADevice; + using HitsOnHost = TrackingRecHitSoAHost; using hindex_type = typename TrackingRecHitSoA::hindex_type; using HitToTuple = caStructures::HitToTupleT; @@ -66,9 +62,9 @@ class CAHitNtupletGeneratorOnGPU { void beginJob(); void endJob(); - TrackSoADevice makeTuplesAsync(HitsOnGPU const& hits_d, float bfield, cudaStream_t stream) const; + TrackSoADevice makeTuplesAsync(HitsOnDevice const& hits_d, float bfield, cudaStream_t stream) const; - TrackSoAHost makeTuples(HitsOnCPU const& hits_d, float bfield) const; + TrackSoAHost makeTuples(HitsOnHost const& hits_d, float bfield) const; private: void buildDoublets(const HitsConstView& hh, cudaStream_t stream) const;