Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-10-25 03:22:17

0001 #ifndef HeterogeneousCore_AlpakaInterface_interface_traits_h
0002 #define HeterogeneousCore_AlpakaInterface_interface_traits_h
0003 
0004 #include <type_traits>
0005 
0006 #if __cplusplus >= 202002L
0007 namespace cms {
0008   using std::is_bounded_array;
0009   using std::is_unbounded_array;
0010 }  // namespace cms
0011 #else
0012 #include <boost/type_traits/is_bounded_array.hpp>
0013 #include <boost/type_traits/is_unbounded_array.hpp>
0014 namespace cms {
0015   using boost::is_bounded_array;
0016   using boost::is_unbounded_array;
0017 }  // namespace cms
0018 #endif
0019 
0020 namespace cms {
0021   template <typename T>
0022   inline constexpr bool is_bounded_array_v = is_bounded_array<T>::value;
0023 
0024   template <typename T>
0025   inline constexpr bool is_unbounded_array_v = is_unbounded_array<T>::value;
0026 }  // namespace cms
0027 
0028 #include <alpaka/alpaka.hpp>
0029 
0030 namespace cms::alpakatools {
0031 
0032   // is_platform
0033 
0034   template <typename T>
0035   using is_platform = alpaka::concepts::ImplementsConcept<alpaka::ConceptPltf, T>;
0036 
0037   template <typename T>
0038   inline constexpr bool is_platform_v = is_platform<T>::value;
0039 
0040   // is_device
0041 
0042   template <typename T>
0043   using is_device = alpaka::concepts::ImplementsConcept<alpaka::ConceptDev, T>;
0044 
0045   template <typename T>
0046   inline constexpr bool is_device_v = is_device<T>::value;
0047 
0048   // is_accelerator
0049 
0050   template <typename T>
0051   using is_accelerator = alpaka::concepts::ImplementsConcept<alpaka::ConceptAcc, T>;
0052 
0053   template <typename T>
0054   inline constexpr bool is_accelerator_v = is_accelerator<T>::value;
0055 
0056   // is_queue
0057 
0058   template <typename T>
0059   using is_queue = alpaka::concepts::ImplementsConcept<alpaka::ConceptQueue, T>;
0060 
0061   template <typename T>
0062   inline constexpr bool is_queue_v = is_queue<T>::value;
0063 
0064 }  // namespace cms::alpakatools
0065 
0066 #endif  // HeterogeneousCore_AlpakaInterface_interface_traits_h