Skip to content

Commit 26f26f3

Browse files
committed
change check to edg
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+.
1 parent e8e5798 commit 26f26f3

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

include/camp/tuple.hpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ namespace internal
8787
{
8888
template <camp::idx_t index, typename Type>
8989
struct tuple_storage {
90-
#if defined(__NVCC__)
91-
// NVCC up until at least 10.1 can't do aggregate initialization of a pack
92-
// of base classes, keep this around until that's fixed
90+
#if defined(__EDG__)
91+
// EDG apparently can't do aggregate initialization of a pack
92+
// of base classes, keep this around until that's fixed, seen in icpc 19.0.4
93+
// and nvcc 10.1
9394
CAMP_HOST_DEVICE constexpr tuple_storage() : val(){};
9495

9596
CAMP_SUPPRESS_HD_WARN
@@ -117,8 +118,8 @@ namespace internal
117118
constexpr tuple_helper() = default;
118119
constexpr tuple_helper(tuple_helper const&) = default;
119120
constexpr tuple_helper(tuple_helper&&) = default;
121+
#else
120122

121-
#else
122123
// NOTE: this is to work around nvcc 9 series issues with incorrect
123124
// creation of defaulted constructors
124125
template <
@@ -140,11 +141,21 @@ namespace internal
140141
}
141142
#endif
142143

144+
#if !defined(__EDG__)
143145
template <typename... Args>
144146
CAMP_HOST_DEVICE constexpr tuple_helper(Args&&... args)
145147
: tuple_storage<Indices, Types>{std::forward<Args>(args)}...
146148
{
147149
}
150+
#else
151+
152+
template <typename... Args>
153+
CAMP_HOST_DEVICE constexpr tuple_helper(Args&&... args)
154+
: tuple_storage<Indices, Types>(std::forward<Args>(args))...
155+
{
156+
}
157+
#endif
158+
148159

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

0 commit comments

Comments
 (0)