Skip to content

Commit

Permalink
change check to edg
Browse files Browse the repository at this point in the history
It's not entirely nvcc's fault, edg is broken for the pack expansion
thing, but the host-device default stuff, that's nvcc's fault.  Might be
able to fix in 10+.
  • Loading branch information
trws committed Nov 16, 2019
1 parent e8e5798 commit 26f26f3
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions include/camp/tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ namespace internal
{
template <camp::idx_t index, typename Type>
struct tuple_storage {
#if defined(__NVCC__)
// NVCC up until at least 10.1 can't do aggregate initialization of a pack
// of base classes, keep this around until that's fixed
#if defined(__EDG__)
// EDG apparently can't do aggregate initialization of a pack
// of base classes, keep this around until that's fixed, seen in icpc 19.0.4
// and nvcc 10.1
CAMP_HOST_DEVICE constexpr tuple_storage() : val(){};

CAMP_SUPPRESS_HD_WARN
Expand Down Expand Up @@ -117,8 +118,8 @@ namespace internal
constexpr tuple_helper() = default;
constexpr tuple_helper(tuple_helper const&) = default;
constexpr tuple_helper(tuple_helper&&) = default;
#else

#else
// NOTE: this is to work around nvcc 9 series issues with incorrect
// creation of defaulted constructors
template <
Expand All @@ -140,11 +141,21 @@ namespace internal
}
#endif

#if !defined(__EDG__)
template <typename... Args>
CAMP_HOST_DEVICE constexpr tuple_helper(Args&&... args)
: tuple_storage<Indices, Types>{std::forward<Args>(args)}...
{
}
#else

template <typename... Args>
CAMP_HOST_DEVICE constexpr tuple_helper(Args&&... args)
: tuple_storage<Indices, Types>(std::forward<Args>(args))...
{
}
#endif


tuple_helper& operator=(const tuple_helper& rhs) = default;

Expand Down

0 comments on commit 26f26f3

Please sign in to comment.