Skip to content

Commit

Permalink
fix cray clang compile issue
Browse files Browse the repository at this point in the history
```
include/alpaka/acc/TagAccIsEnabled.hpp:34:66: error: template template argument has different template parameters than its corresponding template template parameter
   34 |     using EnabledAccTags = alpaka::meta::Filter<AccTags, alpaka::AccIsEnabled>;
      |                                                                  ^
```
  • Loading branch information
psychocoderHPC committed Sep 23, 2024
1 parent 5c5a690 commit 128d446
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions include/alpaka/meta/Filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ namespace alpaka::meta
{
namespace detail
{
template<template<typename...> class TList, template<typename> class TPred, typename... Ts>
template<template<typename...> class TList, template<typename...> class TPred, typename... Ts>
struct FilterImplHelper;

template<template<typename...> class TList, template<typename> class TPred>
template<template<typename...> class TList, template<typename...> class TPred>
struct FilterImplHelper<TList, TPred>
{
using type = TList<>;
};

template<template<typename...> class TList, template<typename> class TPred, typename T, typename... Ts>
template<template<typename...> class TList, template<typename...> class TPred, typename T, typename... Ts>
struct FilterImplHelper<TList, TPred, T, Ts...>
{
using type = std::conditional_t<
Expand All @@ -30,15 +30,18 @@ namespace alpaka::meta
typename FilterImplHelper<TList, TPred, Ts...>::type>;
};

template<typename TList, template<typename> class TPred>
template<typename TList, template<typename...> class TPred>
struct FilterImpl;

template<template<typename...> class TList, template<typename> class TPred, typename... Ts>
template<template<typename...> class TList, template<typename...> class TPred, typename... Ts>
struct FilterImpl<TList<Ts...>, TPred>
{
using type = typename detail::FilterImplHelper<TList, TPred, Ts...>::type;
};
} // namespace detail
template<typename TList, template<typename> class TPred>

/// \tparam TPred Only the first parameter is used, all other must be set by TPred to some default.
/// Using '...' instead of a single type is a workaround for CrayClang.
template<typename TList, template<typename...> class TPred>
using Filter = typename detail::FilterImpl<TList, TPred>::type;
} // namespace alpaka::meta

0 comments on commit 128d446

Please sign in to comment.