Skip to content

Commit

Permalink
Workaround for CUDA10.2.89 CUDA extension compilation error (pytorch#…
Browse files Browse the repository at this point in the history
…33230)

Summary:
Fixes: pytorch#33203
PR based on mpark/variant#73

Verified locally on CUDA10.2.89 and 10.1.243

Thanks ngimel for the hint and gridley for the initial fix in the variant repo! :)
Pull Request resolved: pytorch#33230

Differential Revision: D19858083

Pulled By: ngimel

fbshipit-source-id: b9438084f5688712c6aa6b17813c68ccde237bbb
  • Loading branch information
ptrblck authored and facebook-github-bot committed Feb 12, 2020
1 parent 40265e2 commit ab14375
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions c10/util/variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -2702,20 +2702,20 @@ namespace c10 {
#ifdef MPARK_CPP14_CONSTEXPR
namespace detail_ {

inline constexpr bool all(std::initializer_list<bool> bs) {
inline constexpr bool any(std::initializer_list<bool> bs) {
for (bool b : bs) {
if (!b) {
return false;
if (b) {
return true;
}
}
return true;
return false;
}

} // namespace detail_

template <typename Visitor, typename... Vs>
inline constexpr decltype(auto) visit(Visitor &&visitor, Vs &&... vs) {
return (detail_::all({!vs.valueless_by_exception()...})
return (!detail_::any({vs.valueless_by_exception()...})
? (void)0
: throw_bad_variant_access()),
detail_::visitation::variant::visit_value(
Expand Down

0 comments on commit ab14375

Please sign in to comment.