Skip to content

Commit

Permalink
Merge pull request #39826 from fwyzard/alpaka_framework
Browse files Browse the repository at this point in the history
Mark alpaka trait constants as inline
  • Loading branch information
cmsbuild authored Oct 24, 2022
2 parents a993c0f + 4bb0968 commit 1cb04e7
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions HeterogeneousCore/AlpakaInterface/interface/traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,37 +32,34 @@ namespace cms::alpakatools {
// is_platform

template <typename T>
struct is_platform
: std::integral_constant<bool, alpaka::concepts::ImplementsConcept<alpaka::ConceptPltf, T>::value> {};
using is_platform = alpaka::concepts::ImplementsConcept<alpaka::ConceptPltf, T>;

template <typename T>
constexpr bool is_platform_v = is_platform<T>::value;
inline constexpr bool is_platform_v = is_platform<T>::value;

// is_device

template <typename T>
struct is_device : std::integral_constant<bool, alpaka::concepts::ImplementsConcept<alpaka::ConceptDev, T>::value> {};
using is_device = alpaka::concepts::ImplementsConcept<alpaka::ConceptDev, T>;

template <typename T>
constexpr bool is_device_v = is_device<T>::value;
inline constexpr bool is_device_v = is_device<T>::value;

// is_accelerator

template <typename T>
struct is_accelerator
: std::integral_constant<bool, alpaka::concepts::ImplementsConcept<alpaka::ConceptAcc, T>::value> {};
using is_accelerator = alpaka::concepts::ImplementsConcept<alpaka::ConceptAcc, T>;

template <typename T>
constexpr bool is_accelerator_v = is_accelerator<T>::value;
inline constexpr bool is_accelerator_v = is_accelerator<T>::value;

// is_queue

template <typename T>
struct is_queue : std::integral_constant<bool, alpaka::concepts::ImplementsConcept<alpaka::ConceptQueue, T>::value> {
};
using is_queue = alpaka::concepts::ImplementsConcept<alpaka::ConceptQueue, T>;

template <typename T>
constexpr bool is_queue_v = is_queue<T>::value;
inline constexpr bool is_queue_v = is_queue<T>::value;

} // namespace cms::alpakatools

Expand Down

0 comments on commit 1cb04e7

Please sign in to comment.