forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 1
GPU JetCore Cluster Splitter #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AdrianoDee
wants to merge
9
commits into
gpu_splitter_forPR
Choose a base branch
from
gpu_cluster_splitter_151X
base: gpu_splitter_forPR
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
8f76c4a
Rebase to CMSSW 15.0.0 and update codebase
6688c50
Rebase to CMSSW 15.0.0 and update codebase
8a38b6a
adc aligned to original class
138f41b
fixed distandMap
bd18d31
fixed distandMap
3640e48
Algorithm fully operational compared with original JetCoreClusterSpli…
8ed6429
Added verbose/debug cluster formatted printout
c266130
fixed minor typos in the printouts
cc83c68
Rebase to latest 15_1_X and code-formats
AdrianoDee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| <use name="alpaka"/> | ||
| <use name="rootcore"/> | ||
| <use name="DataFormats/Common"/> | ||
| <use name="DataFormats/Portable"/> | ||
| <use name="DataFormats/SoATemplate" source_only="1"/> | ||
| <use name="HeterogeneousCore/AlpakaInterface"/> | ||
| <use name="RecoLocalTracker/Records"/> | ||
| <use name="Geometry/TrackerGeometryBuilder"/> | ||
| <use name="Geometry/Records"/> | ||
| <use name="FWCore/Utilities"/> | ||
| <flags ALPAKA_BACKENDS="!serial"/> | ||
| <export> | ||
| <lib name="1"/> | ||
| </export> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #ifndef DataFormats_CandidateSoA_interface_CandidatesDevice_h | ||
| #define DataFormats_CandidateSoA_interface_CandidatesDevice_h | ||
|
|
||
| #include <cstdint> | ||
| #include <alpaka/alpaka.hpp> | ||
|
|
||
| #include "DataFormats/Portable/interface/PortableDeviceCollection.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesSoA.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
|
||
| template <typename TDev> | ||
| class CandidatesDevice : public PortableDeviceCollection<CandidatesSoA, TDev> { | ||
| public: | ||
| CandidatesDevice(edm::Uninitialized) : PortableDeviceCollection<CandidatesSoA, TDev>{edm::kUninitialized} {} | ||
|
|
||
| template <typename TQueue> | ||
| explicit CandidatesDevice(size_t maxFedWords, TQueue queue) | ||
| : PortableDeviceCollection<CandidatesSoA, TDev>(maxFedWords + 1, queue) {} | ||
|
|
||
| // Constructor which specifies the SoA size | ||
| explicit CandidatesDevice(size_t maxFedWords, TDev const &device) | ||
| : PortableDeviceCollection<CandidatesSoA, TDev>(maxFedWords + 1, device) {} | ||
|
|
||
| void setNModules(uint32_t nModules) { nModules_h = nModules; } | ||
|
|
||
| uint32_t nModules() const { return nModules_h; } | ||
| uint32_t nDigis() const { return this->view().metadata().size() - 1; } | ||
|
|
||
| private: | ||
| uint32_t nModules_h = 0; | ||
| }; | ||
|
|
||
| #endif // DataFormats_CandidateSoA_interface_CandidatesDevice_h | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #ifndef DataFormats_CandidateSoA_interface_CandidatesHost_h | ||
| #define DataFormats_CandidateSoA_interface_CandidatesHost_h | ||
|
|
||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesSoA.h" | ||
|
|
||
| class CandidatesHost : public PortableHostCollection<CandidatesSoA> { | ||
| public: | ||
| CandidatesHost(edm::Uninitialized) : PortableHostCollection<CandidatesSoA>{edm::kUninitialized} {} | ||
|
|
||
| template <typename TQueue> | ||
| explicit CandidatesHost(size_t maxFedWords, TQueue queue) | ||
| : PortableHostCollection<CandidatesSoA>(maxFedWords + 1, queue) {} | ||
|
|
||
| void setNModules(uint32_t nModules) { nModules_h = nModules; } | ||
|
|
||
| uint32_t nModules() const { return nModules_h; } | ||
| uint32_t nDigis() const { return view().metadata().size() - 1; } | ||
|
|
||
| private: | ||
| uint32_t nModules_h = 0; | ||
| }; | ||
|
|
||
| #endif // DataFormats_CandidateSoA_interface_CandidatesHost_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #ifndef DataFormats_CandidateSoA_interface_CandidatesSoA_h | ||
| #define DataFormats_CandidateSoA_interface_CandidatesSoA_h | ||
|
|
||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
|
|
||
| GENERATE_SOA_LAYOUT(CandidatesLayout, | ||
| SOA_COLUMN(uint32_t, candidateIndex), | ||
| SOA_COLUMN(float, px), | ||
| SOA_COLUMN(float, py), | ||
| SOA_COLUMN(float, pz), | ||
| SOA_COLUMN(float, pt), | ||
| SOA_COLUMN(float, eta), | ||
| SOA_COLUMN(float, phi)) | ||
|
|
||
| using CandidatesSoA = CandidatesLayout<>; | ||
| using CandidatesSoAView = CandidatesSoA::View; | ||
| using CandidatesSoAConstView = CandidatesSoA::ConstView; | ||
|
|
||
| #endif // DataFormats_CandidateSoA_interface_CandidatesSoA_h |
36 changes: 36 additions & 0 deletions
36
DataFormats/CandidateSoA/interface/alpaka/CandidatesSoACollection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #ifndef DataFormats_CandidateSoA_interface_alpaka_CandidatesSoACollection_h | ||
| #define DataFormats_CandidateSoA_interface_alpaka_CandidatesSoACollection_h | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| #include <alpaka/alpaka.hpp> | ||
|
|
||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesDevice.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesHost.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
|
||
| namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
|
||
| using CandidatesSoACollection = | ||
| std::conditional_t<std::is_same_v<Device, alpaka::DevCpu>, CandidatesHost, CandidatesDevice<Device>>; | ||
|
|
||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
| namespace cms::alpakatools { | ||
| template <typename TDevice> | ||
| struct CopyToHost<CandidatesDevice<TDevice>> { | ||
| template <typename TQueue> | ||
| static auto copyAsync(TQueue &queue, CandidatesDevice<TDevice> const &srcData) { | ||
| CandidatesHost dstData(srcData.view().metadata().size() - 1, queue); | ||
| alpaka::memcpy(queue, dstData.buffer(), srcData.buffer()); | ||
| dstData.setNModules(srcData.nModules()); | ||
| return dstData; | ||
| } | ||
| }; | ||
| } // namespace cms::alpakatools | ||
|
|
||
| ASSERT_DEVICE_MATCHES_HOST_COLLECTION(CandidatesSoACollection, CandidatesHost); | ||
|
|
||
| #endif // DataFormats_CandidateSoA_interface_alpaka_CandidatesSoACollection_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #ifndef DataFormats_CandidateSoA_Alpaka_Classes_cuda_h | ||
| #define DataFormats_CandidateSoA_Alpaka_Classes_cuda_h | ||
|
|
||
| #include "DataFormats/Common/interface/DeviceProduct.h" | ||
| #include "DataFormats/Common/interface/Wrapper.h" | ||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesSoA.h" | ||
| #include "DataFormats/CandidateSoA/interface/alpaka/CandidatesSoACollection.h" | ||
|
|
||
| #endif // DataFormats_CandidateSoA_src_alpaka_classes_cuda_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <lcgdict> | ||
| <!-- CandidatesSoA-related collections --> | ||
| <class name="alpaka_cuda_async::PortableCollection<CandidatesSoA>" persistent="false"/> | ||
| <!-- CandidatesSoACollection inherits from PortableCollection<CandidatesSoA> --> | ||
| <class name="alpaka_cuda_async::CandidatesSoACollection" persistent="false"/> | ||
| <class name="edm::DeviceProduct<alpaka_cuda_async::CandidatesSoACollection>" persistent="false"/> | ||
| <class name="edm::Wrapper<edm::DeviceProduct<alpaka_cuda_async::CandidatesSoACollection>>" persistent="false"/> | ||
|
|
||
| </lcgdict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #ifndef DataFormats_CandidateSoA_Alpaka_Classes_cuda_h | ||
| #define DataFormats_CandidateSoA_Alpaka_Classes_cuda_h | ||
|
|
||
| #include "DataFormats/Common/interface/DeviceProduct.h" | ||
| #include "DataFormats/Common/interface/Wrapper.h" | ||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesDevice.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesSoA.h" | ||
| #include "DataFormats/CandidateSoA/interface/alpaka/CandidatesSoACollection.h" | ||
|
|
||
| #endif // DataFormats_CandidateSoA_src_alpaka_classes_cuda_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <lcgdict> | ||
| <!-- CandidatesSoA-related collections --> | ||
| <class name="alpaka_rocm_async::PortableCollection<CandidatesSoA>" persistent="false"/> | ||
| <!-- CandidatesSoACollection inherits from PortableCollection<CandidatesSoA> --> | ||
| <class name="alpaka_rocm_async::CandidatesSoACollection" persistent="false"/> | ||
| <class name="edm::DeviceProduct<alpaka_rocm_async::CandidatesSoACollection>" persistent="false"/> | ||
| <class name="edm::Wrapper<edm::DeviceProduct<alpaka_rocm_async::CandidatesSoACollection>>" persistent="false"/> | ||
|
|
||
| </lcgdict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "DataFormats/Portable/interface/PortableHostCollectionReadRules.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesSoA.h" | ||
|
|
||
| SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection<CandidatesSoA>); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #ifndef DataFormats_CandidatesSoA_src_classes_h | ||
| #define DataFormats_CandidatesSoA_src_classes_h | ||
|
|
||
| #include "DataFormats/Common/interface/Wrapper.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesHost.h" | ||
| #include "DataFormats/CandidateSoA/interface/CandidatesSoA.h" | ||
|
|
||
| #endif // DataFormats_SiPixelClusterSoA_src_classes_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <lcgdict> | ||
| <class name="CandidatesSoA"/> | ||
| <class name="CandidatesSoA::View"/> | ||
| <class name="PortableHostCollection<CandidatesSoA>"/> | ||
| <class name="CandidatesHost"/> | ||
| <class name="edm::Wrapper<CandidatesHost>" splitLevel="0"/> | ||
| </lcgdict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <use name="alpaka"/> | ||
| <use name="rootcore"/> | ||
| <use name="DataFormats/Common"/> | ||
| <use name="DataFormats/Portable"/> | ||
| <use name="DataFormats/SoATemplate" source_only="1"/> | ||
| <use name="HeterogeneousCore/AlpakaInterface"/> | ||
| <use name="RecoLocalTracker/Records"/> | ||
| <use name="Geometry/TrackerGeometryBuilder"/> | ||
| <use name="Geometry/Records"/> | ||
| <flags ALPAKA_BACKENDS="!serial"/> | ||
| <export> | ||
| <lib name="1"/> | ||
| </export> |
35 changes: 35 additions & 0 deletions
35
DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysDevice.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #ifndef DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysDevice_h | ||
| #define DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysDevice_h | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| #include <alpaka/alpaka.hpp> | ||
|
|
||
| #include "DataFormats/Portable/interface/PortableDeviceCollection.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysSoA.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
|
||
| template <typename TDev> | ||
| class ClusterGeometrysDevice : public PortableDeviceCollection<ClusterGeometrysSoA, TDev> { | ||
| public: | ||
| ClusterGeometrysDevice(edm::Uninitialized) | ||
| : PortableDeviceCollection<ClusterGeometrysSoA, TDev>{edm::kUninitialized} {} | ||
|
|
||
| template <typename TQueue> | ||
| explicit ClusterGeometrysDevice(size_t maxFedWords, TQueue queue) | ||
| : PortableDeviceCollection<ClusterGeometrysSoA, TDev>(maxFedWords + 1, queue) {} | ||
|
|
||
| // Constructor which specifies the SoA size | ||
| explicit ClusterGeometrysDevice(size_t maxFedWords, TDev const &device) | ||
| : PortableDeviceCollection<ClusterGeometrysSoA, TDev>(maxFedWords + 1, device) {} | ||
|
|
||
| void setNModules(uint32_t nModules) { nModules_h = nModules; } | ||
|
|
||
| uint32_t nModules() const { return nModules_h; } | ||
| uint32_t nDigis() const { return this->view().metadata().size() - 1; } | ||
|
|
||
| private: | ||
| uint32_t nModules_h = 0; | ||
| }; | ||
|
|
||
| #endif // DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysDevice_h |
27 changes: 27 additions & 0 deletions
27
DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysHost.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #ifndef DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysHost_h | ||
| #define DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysHost_h | ||
|
|
||
| #include "DataFormats/Portable/interface/PortableHostCollection.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysSoA.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 ClusterGeometrysHost : public PortableHostCollection<ClusterGeometrysSoA> { | ||
| public: | ||
| ClusterGeometrysHost(edm::Uninitialized) : PortableHostCollection<ClusterGeometrysSoA>{edm::kUninitialized} {} | ||
|
|
||
| template <typename TQueue> | ||
| explicit ClusterGeometrysHost(size_t maxFedWords, TQueue queue) | ||
| : PortableHostCollection<ClusterGeometrysSoA>(maxFedWords + 1, queue) {} | ||
|
|
||
| void setNModules(uint32_t nModules) { nModules_h = nModules; } | ||
|
|
||
| uint32_t nModules() const { return nModules_h; } | ||
| uint32_t nDigis() const { return view().metadata().size() - 1; } | ||
|
|
||
| private: | ||
| uint32_t nModules_h = 0; | ||
| }; | ||
|
|
||
| #endif // DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysHost_h |
33 changes: 33 additions & 0 deletions
33
DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysSoA.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #ifndef DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysSoA_h | ||
| #define DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysSoA_h | ||
|
|
||
| #include "DataFormats/SoATemplate/interface/SoALayout.h" | ||
|
|
||
| GENERATE_SOA_LAYOUT(ClusterGeometrysLayout, | ||
| SOA_COLUMN(uint32_t, clusterIds), | ||
| SOA_COLUMN(float, pitchX), | ||
| SOA_COLUMN(float, pitchY), | ||
| SOA_COLUMN(float, thickness), | ||
| SOA_COLUMN(float, tanLorentzAngles), | ||
| SOA_COLUMN(float, transformXX), | ||
| SOA_COLUMN(float, transformXY), | ||
| SOA_COLUMN(float, transformXZ), | ||
| SOA_COLUMN(float, transformYX), | ||
| SOA_COLUMN(float, transformYY), | ||
| SOA_COLUMN(float, transformYZ), | ||
| SOA_COLUMN(float, transformZX), | ||
| SOA_COLUMN(float, transformZY), | ||
| SOA_COLUMN(float, transformZZ), | ||
| SOA_COLUMN(float, x), | ||
| SOA_COLUMN(float, y), | ||
| SOA_COLUMN(float, z), | ||
| SOA_COLUMN(uint32_t, sizeX), | ||
| SOA_COLUMN(uint32_t, sizeY), | ||
| SOA_COLUMN(uint32_t, clusterOffset), | ||
| SOA_COLUMN(uint32_t, moduleId)) | ||
|
|
||
| using ClusterGeometrysSoA = ClusterGeometrysLayout<>; | ||
| using ClusterGeometrysSoAView = ClusterGeometrysSoA::View; | ||
| using ClusterGeometrysSoAConstView = ClusterGeometrysSoA::ConstView; | ||
|
|
||
| #endif // DataFormats_ClusterGeometrySoA_interface_ClusterGeometrysSoA_h |
36 changes: 36 additions & 0 deletions
36
DataFormats/ClusterGeometrySoA/interface/alpaka/ClusterGeometrysSoACollection.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| #ifndef DataFormats_ClusterGeometrySoA_interface_alpaka_ClusterGeometrysSoACollection_h | ||
| #define DataFormats_ClusterGeometrySoA_interface_alpaka_ClusterGeometrysSoACollection_h | ||
|
|
||
| #include <cstdint> | ||
|
|
||
| #include <alpaka/alpaka.hpp> | ||
|
|
||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysDevice.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysHost.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/CopyToHost.h" | ||
| #include "HeterogeneousCore/AlpakaInterface/interface/config.h" | ||
|
|
||
| namespace ALPAKA_ACCELERATOR_NAMESPACE { | ||
|
|
||
| using ClusterGeometrysSoACollection = | ||
| std::conditional_t<std::is_same_v<Device, alpaka::DevCpu>, ClusterGeometrysHost, ClusterGeometrysDevice<Device>>; | ||
|
|
||
| } // namespace ALPAKA_ACCELERATOR_NAMESPACE | ||
|
|
||
| namespace cms::alpakatools { | ||
| template <typename TDevice> | ||
| struct CopyToHost<ClusterGeometrysDevice<TDevice>> { | ||
| template <typename TQueue> | ||
| static auto copyAsync(TQueue &queue, ClusterGeometrysDevice<TDevice> const &srcData) { | ||
| ClusterGeometrysHost dstData(srcData.view().metadata().size() - 1, queue); | ||
| alpaka::memcpy(queue, dstData.buffer(), srcData.buffer()); | ||
| dstData.setNModules(srcData.nModules()); | ||
| return dstData; | ||
| } | ||
| }; | ||
| } // namespace cms::alpakatools | ||
|
|
||
| ASSERT_DEVICE_MATCHES_HOST_COLLECTION(ClusterGeometrysSoACollection, ClusterGeometrysHost); | ||
|
|
||
| #endif // DataFormats_ClusterGeometrySoA_interface_alpaka_ClusterGeometrysSoACollection_h |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| #ifndef DataFormats_ClusterGeometrySoA_Alpaka_Classes_cuda_h | ||
| #define DataFormats_ClusterGeometrySoA_Alpaka_Classes_cuda_h | ||
|
|
||
| #include "DataFormats/Common/interface/DeviceProduct.h" | ||
| #include "DataFormats/Common/interface/Wrapper.h" | ||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysSoA.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/alpaka/ClusterGeometrysSoACollection.h" | ||
|
|
||
| #endif // DataFormats_ClusterGeometrySoA_src_alpaka_classes_cuda_h |
9 changes: 9 additions & 0 deletions
9
DataFormats/ClusterGeometrySoA/src/alpaka/classes_cuda_def.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <lcgdict> | ||
| <!-- ClusterGeometrysSoA-related collections --> | ||
| <class name="alpaka_cuda_async::PortableCollection<ClusterGeometrysSoA>" persistent="false"/> | ||
| <!-- ClusterGeometrysSoACollection inherits from PortableCollection<ClusterGeometrysSoA> --> | ||
| <class name="alpaka_cuda_async::ClusterGeometrysSoACollection" persistent="false"/> | ||
| <class name="edm::DeviceProduct<alpaka_cuda_async::ClusterGeometrysSoACollection>" persistent="false"/> | ||
| <class name="edm::Wrapper<edm::DeviceProduct<alpaka_cuda_async::ClusterGeometrysSoACollection>>" persistent="false"/> | ||
|
|
||
| </lcgdict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #ifndef DataFormats_ClusterGeometrySoA_Alpaka_Classes_cuda_h | ||
| #define DataFormats_ClusterGeometrySoA_Alpaka_Classes_cuda_h | ||
|
|
||
| #include "DataFormats/Common/interface/DeviceProduct.h" | ||
| #include "DataFormats/Common/interface/Wrapper.h" | ||
| #include "DataFormats/Portable/interface/alpaka/PortableCollection.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysDevice.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysSoA.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/alpaka/ClusterGeometrysSoACollection.h" | ||
|
|
||
| #endif // DataFormats_ClusterGeometrySoA_src_alpaka_classes_cuda_h |
9 changes: 9 additions & 0 deletions
9
DataFormats/ClusterGeometrySoA/src/alpaka/classes_rocm_def.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| <lcgdict> | ||
| <!-- ClusterGeometrysSoA-related collections --> | ||
| <class name="alpaka_rocm_async::PortableCollection<ClusterGeometrysSoA>" persistent="false"/> | ||
| <!-- ClusterGeometrysSoACollection inherits from PortableCollection<ClusterGeometrysSoA> --> | ||
| <class name="alpaka_rocm_async::ClusterGeometrysSoACollection" persistent="false"/> | ||
| <class name="edm::DeviceProduct<alpaka_rocm_async::ClusterGeometrysSoACollection>" persistent="false"/> | ||
| <class name="edm::Wrapper<edm::DeviceProduct<alpaka_rocm_async::ClusterGeometrysSoACollection>>" persistent="false"/> | ||
|
|
||
| </lcgdict> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #include "DataFormats/Portable/interface/PortableHostCollectionReadRules.h" | ||
| #include "DataFormats/ClusterGeometrySoA/interface/ClusterGeometrysSoA.h" | ||
|
|
||
| SET_PORTABLEHOSTCOLLECTION_READ_RULES(PortableHostCollection<ClusterGeometrysSoA>); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Credo tutto questo si possa togliere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assolutamente scusa, era legacy (anche nel geoCluster)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E figurati, sto semplificando la
CanidateSoA(Host,Device,Collection).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grazie!