Commit 06c5f161 authored by Robert Maynard's avatar Robert Maynard
Browse files

Teach brigand about more intel compiler limitations introduced in 18.X.

parent a1a23f83
...@@ -235,6 +235,19 @@ namespace detail ...@@ -235,6 +235,19 @@ namespace detail
} }
namespace brigand namespace brigand
{ {
template<typename T, typename U>
struct same
{
using type = T;
};
template<typename T>
struct same<T, std::true_type>
{
static_assert(std::is_same<T, std::true_type>::value, "");
using type = T;
};
namespace detail namespace detail
{ {
template<class T> struct element_at; template<class T> struct element_at;
...@@ -243,21 +256,20 @@ namespace brigand ...@@ -243,21 +256,20 @@ namespace brigand
{ {
template<class T> type_<T> static at(Ts..., type_<T>*, ...); template<class T> type_<T> static at(Ts..., type_<T>*, ...);
//CUDA 9 version that is required //CUDA 9 and Intel 18 version that is required
template<class R, class... Other> type_<R> static at_with_type(Ts..., R, Other...); template<class T, class... Other> T static at_with_type(Ts..., T*, Other...);
}; };
template<class T> T extract_type(type_<T>*);
template<std::size_t N, typename Seq> struct at_impl; template<std::size_t N, typename Seq> struct at_impl;
#if defined(BRIGAND_COMP_CUDA_9) #if defined(BRIGAND_COMP_CUDA_9) || defined(BRIGAND_COMP_INTEL)
//Only needed for CUDA 9 RC1 as it has some compiler bugs //Both CUDA 9 and the Intel 18 compiler series have a problem deducing the
//type so we are just going
template <std::size_t N, template <typename...> class L, class... Ts> template <std::size_t N, template <typename...> class L, class... Ts>
struct at_impl<N, L<Ts...>> struct at_impl<N, L<Ts...>>
{ {
using base_with_type = decltype( using base_with_type = decltype(
element_at<filled_list<void const*, N>>::at_with_type(static_cast<type_<Ts>*>(nullptr)...)); element_at<filled_list<void const*, N>>::at_with_type(static_cast<type_<Ts>*>(nullptr)...));
using type = decltype(extract_type(typename base_with_type::type{})); using type = typename base_with_type::type;
}; };
#else #else
// This is the original implementation // This is the original implementation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment