ESGetToken

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#ifndef HeterogeneousCore_AlpakaCore_interface_alpaka_ESGetToken_h
#define HeterogeneousCore_AlpakaCore_interface_alpaka_ESGetToken_h

#include "FWCore/Utilities/interface/ESGetToken.h"
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/ESDeviceProductType.h"
#include "HeterogeneousCore/AlpakaInterface/interface/config.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE::device {
  class EventSetup;
  template <typename T>
  class Record;

  /**
   * The device::ESGetToken is similar to edm::ESGetToken, but is
   * intended for EventSetup data products in the device memory space
   * defined by the backend (i.e. ALPAKA_ACCELERATOR_NAMESPACE). It
   * can be used only to get data from a device::EventSetup and
   * device::Record<T>.
   */
  template <typename ESProduct, typename ESRecord>
  class ESGetToken {
  public:
    constexpr ESGetToken() noexcept = default;

    template <typename TAdapter>
    constexpr ESGetToken(TAdapter&& iAdapter) : token_(std::forward<TAdapter>(iAdapter)) {}

  private:
    friend class EventSetup;
    template <typename T>
    friend class Record;

    auto const& underlyingToken() const { return token_; }

    using ProductType = detail::ESDeviceProductType<ESProduct>;
    edm::ESGetToken<ProductType, ESRecord> token_;
  };
}  // namespace ALPAKA_ACCELERATOR_NAMESPACE::device

#endif