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_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 namespace ALPAKA_ACCELERATOR_NAMESPACE::detail {
0008   /**
0009    * This "trait" class abstracts the actual product type put in the
0010    * edm::Event.
0011    */
0012   template <typename TProduct>
0013   struct DeviceProductType {
0014 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
0015     // host synchronous backends can use TProduct directly
0016     using type = TProduct;
0017 #else
0018     // all device and asynchronous backends need to be wrapped
0019     using type = edm::DeviceProduct<TProduct>;
0020 #endif
0021   };
0022 
0023   template <typename TProduct>
0024   inline constexpr bool useProductDirectly = std::is_same_v<typename DeviceProductType<TProduct>::type, TProduct>;
0025 }  // namespace ALPAKA_ACCELERATOR_NAMESPACE::detail
0026 
0027 #endif