Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-01-08 03:36:18

0001 #ifndef HeterogeneousCore_AlpakaCore_interface_alpaka_DeviceProductType_h
0002 #define HeterogeneousCore_AlpakaCore_interface_alpaka_DeviceProductType_h
0003 
0004 #include "DataFormats/Common/interface/DeviceProduct.h"
0005 #include "HeterogeneousCore/AlpakaInterface/interface/config.h"
0006 
0007 #include <type_traits>
0008 
0009 namespace ALPAKA_ACCELERATOR_NAMESPACE::detail {
0010   // host synchronous backends can use TProduct directly
0011   // all device and asynchronous backends need to be wrapped
0012   inline constexpr bool useProductDirectly =
0013       std::is_same_v<Platform, alpaka::PlatformCpu> and std::is_same_v<Queue, alpaka::QueueCpuBlocking>;
0014 
0015   /**
0016    * Type alias for the actual product type put in the
0017    * edm::Event.
0018    */
0019   template <typename TProduct>
0020   using DeviceProductType = std::conditional_t<useProductDirectly, TProduct, edm::DeviceProduct<TProduct>>;
0021 
0022 }  // namespace ALPAKA_ACCELERATOR_NAMESPACE::detail
0023 
0024 #endif