| 512 | // Unwrap rank-1 tuples until we're left with a rank>1 tuple or a non-tuple |
| 513 | template <class T> |
| 514 | CUTE_HOST_DEVICE constexpr |
| 515 | auto |
| 516 | unwrap(T const& t) |
| 517 | { |
| 518 | if constexpr (is_tuple<T>::value) { |
| 519 | if constexpr (tuple_size<T>::value == 1) { |
| 520 | return unwrap(get<0>(t)); |
| 521 | } else { |
| 522 | return t; |
| 523 | } |
| 524 | } else { |
| 525 | return t; |
| 526 | } |
| 527 | |
| 528 | CUTE_GCC_UNREACHABLE; |
| 529 | } |
| 530 | |
| 531 | // |
| 532 | // Flatten and Unflatten |
no outgoing calls