Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:15:39

0001 #ifndef HeterogeneousCore_AlpakaCore_interface_alpaka_ESGetToken_h
0002 #define HeterogeneousCore_AlpakaCore_interface_alpaka_ESGetToken_h
0003 
0004 #include "FWCore/Utilities/interface/ESGetToken.h"
0005 #include "HeterogeneousCore/AlpakaCore/interface/alpaka/ESDeviceProductType.h"
0006 #include "HeterogeneousCore/AlpakaInterface/interface/config.h"
0007 
0008 namespace ALPAKA_ACCELERATOR_NAMESPACE::device {
0009   class EventSetup;
0010   template <typename T>
0011   class Record;
0012 
0013   /**
0014    * The device::ESGetToken is similar to edm::ESGetToken, but is
0015    * intended for EventSetup data products in the device memory space
0016    * defined by the backend (i.e. ALPAKA_ACCELERATOR_NAMESPACE). It
0017    * can be used only to get data from a device::EventSetup and
0018    * device::Record<T>.
0019    */
0020   template <typename ESProduct, typename ESRecord>
0021   class ESGetToken {
0022   public:
0023     constexpr ESGetToken() noexcept = default;
0024 
0025     template <typename TAdapter>
0026     constexpr ESGetToken(TAdapter&& iAdapter) : token_(std::forward<TAdapter>(iAdapter)) {}
0027 
0028   private:
0029     friend class EventSetup;
0030     template <typename T>
0031     friend class Record;
0032 
0033     auto const& underlyingToken() const { return token_; }
0034 
0035     using ProductType = typename detail::ESDeviceProductType<ESProduct>::type;
0036     edm::ESGetToken<ProductType, ESRecord> token_;
0037   };
0038 }  // namespace ALPAKA_ACCELERATOR_NAMESPACE::device
0039 
0040 #endif