diff --git a/CUDADataFormats/CaloCommon/BuildFile.xml b/CUDADataFormats/CaloCommon/BuildFile.xml new file mode 100644 index 0000000000000..635af5bdaf6b3 --- /dev/null +++ b/CUDADataFormats/CaloCommon/BuildFile.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/CUDADataFormats/CaloCommon/interface/Common.h b/CUDADataFormats/CaloCommon/interface/Common.h new file mode 100644 index 0000000000000..1be760ec917df --- /dev/null +++ b/CUDADataFormats/CaloCommon/interface/Common.h @@ -0,0 +1,68 @@ +#ifndef CUDADataFormats_CaloCommon_interface_Common_h +#define CUDADataFormats_CaloCommon_interface_Common_h + +#include + +#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 + struct AddSize {}; + + template <> + struct AddSize { + uint32_t size; + }; + + template <> + struct AddSize { + uint32_t size; + }; + + struct ViewStoragePolicy { + using TagType = tags::Ptr; + + template + struct StorageSelector { + using type = T*; + }; + }; + + struct DevStoragePolicy { + using TagType = tags::DevPtr; + + template + struct StorageSelector { + using type = cms::cuda::device::unique_ptr; + }; + }; + + template