Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Fetch host <utility> to populate tuple_size (#336)
Browse files Browse the repository at this point in the history
* Fetch host `<utility>` to populate `tuple_size`

* Add more words to make intent clearer for why the host standard library is necessary.

Co-authored-by: Jake Hemstad <[email protected]>
  • Loading branch information
wmaxey and jrhemstad authored Dec 1, 2022
1 parent 3fdea17 commit 853bbee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions include/cuda/std/tuple
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
#ifndef _CUDA_TUPLE
#define _CUDA_TUPLE

#if !defined(__CUDACC_RTC__)
// Fetch utility to get primary template for ::std::tuple_size necessary for the specialization of
// ::std::tuple_size<cuda::std::tuple> to enable structured bindings. See https://github.com/NVIDIA/libcudacxx/issues/316
#include <utility>
#endif

#include "cstdint"
#include "climits"

Expand All @@ -29,5 +35,3 @@
#include "detail/__pragma_pop"

#endif //_CUDA_TUPLE


7 changes: 5 additions & 2 deletions include/cuda/std/utility
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
#ifndef _CUDA_UTILITY
#define _CUDA_UTILITY

#if !defined(__CUDACC_RTC__)
// Fetch utility to populate tuple_size
#include <utility>
#endif

#include "type_traits"
#include "version"

Expand All @@ -23,5 +28,3 @@
#include "detail/__pragma_pop"

#endif //_CUDA_UTILITY


0 comments on commit 853bbee

Please sign in to comment.