-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31704 from cms-patatrack/patatrack_integration_6_…
…N_calorimeters_common Patatrack integration - calorimeters shared code (6/N)
- Loading branch information
Showing
7 changed files
with
537 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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,6 @@ | ||
<use name="CUDADataFormats/Common" /> | ||
<use name="HeterogeneousCore/CUDAUtilities"/> | ||
|
||
<export> | ||
<lib name="1"/> | ||
</export> |
This file contains 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,68 @@ | ||
#ifndef CUDADataFormats_CaloCommon_interface_Common_h | ||
#define CUDADataFormats_CaloCommon_interface_Common_h | ||
|
||
#include <vector> | ||
|
||
#include "HeterogeneousCore/CUDAUtilities/interface/HostAllocator.h" | ||
#include "HeterogeneousCore/CUDAUtilities/interface/device_unique_ptr.h" | ||
|
||
namespace calo { | ||
namespace common { | ||
|
||
// FIXME: not able to get enums to work with genreflex | ||
namespace tags { | ||
|
||
struct Vec {}; | ||
struct Ptr {}; | ||
struct DevPtr {}; | ||
|
||
} // namespace tags | ||
|
||
template <typename tag> | ||
struct AddSize {}; | ||
|
||
template <> | ||
struct AddSize<tags::Ptr> { | ||
uint32_t size; | ||
}; | ||
|
||
template <> | ||
struct AddSize<tags::DevPtr> { | ||
uint32_t size; | ||
}; | ||
|
||
struct ViewStoragePolicy { | ||
using TagType = tags::Ptr; | ||
|
||
template <typename T> | ||
struct StorageSelector { | ||
using type = T*; | ||
}; | ||
}; | ||
|
||
struct DevStoragePolicy { | ||
using TagType = tags::DevPtr; | ||
|
||
template <typename T> | ||
struct StorageSelector { | ||
using type = cms::cuda::device::unique_ptr<T[]>; | ||
}; | ||
}; | ||
|
||
template <template <typename> typename Allocator = std::allocator> | ||
struct VecStoragePolicy { | ||
using TagType = tags::Vec; | ||
|
||
template <typename T> | ||
struct StorageSelector { | ||
using type = std::vector<T, Allocator<T>>; | ||
}; | ||
}; | ||
|
||
template <typename T> | ||
using CUDAHostAllocatorAlias = cms::cuda::HostAllocator<T>; | ||
|
||
} // namespace common | ||
} // namespace calo | ||
|
||
#endif // CUDADataFormats_CaloCommon_interface_Common_h |
This file contains 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,2 @@ | ||
#include "DataFormats/Common/interface/Wrapper.h" | ||
#include "CUDADataFormats/CaloCommon/interface/Common.h" |
This file contains 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 @@ | ||
<lcgdict> | ||
<enum name="calo::common::tags::Ptr"/> | ||
<enum name="calo::common::tags::Vec"/> | ||
<enum name="calo::common::tags::DevPtr"/> | ||
<class name="calo::common::AddSize<calo::common::tags::Ptr>"/> | ||
<class name="calo::common::AddSize<calo::common::tags::Vec>"/> | ||
<class name="calo::common::AddSize<calo::common::tags::DevPtr>"/> | ||
</lcgdict> |
Oops, something went wrong.