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