From 752e19bb2b326a72eb22e223325ffc3b66cd4bee Mon Sep 17 00:00:00 2001 From: Andrew Corrigan Date: Mon, 12 Oct 2020 14:18:40 -0400 Subject: [PATCH] implements variadic overload of make_zip_iterator #663 --- thrust/iterator/detail/zip_iterator.inl | 14 +++++++++++--- thrust/iterator/zip_iterator.h | 18 ++++++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/thrust/iterator/detail/zip_iterator.inl b/thrust/iterator/detail/zip_iterator.inl index 7eb35b091b..c5742315e9 100644 --- a/thrust/iterator/detail/zip_iterator.inl +++ b/thrust/iterator/detail/zip_iterator.inl @@ -131,11 +131,19 @@ template } // end zip_iterator::distance_to() -template +template +__host__ __device__ + zip_iterator> make_zip_iterator(thrust::tuple t) +{ + return zip_iterator>(t); +} // end make_zip_iterator() + + +template __host__ __device__ - zip_iterator make_zip_iterator(IteratorTuple t) + zip_iterator> make_zip_iterator(Iterators... its) { - return zip_iterator(t); + return make_zip_iterator(thrust::make_tuple(its...)); } // end make_zip_iterator() diff --git a/thrust/iterator/zip_iterator.h b/thrust/iterator/zip_iterator.h index 7b86d06d51..14f7e873ac 100644 --- a/thrust/iterator/zip_iterator.h +++ b/thrust/iterator/zip_iterator.h @@ -229,9 +229,23 @@ template * * \see zip_iterator */ -template +template inline __host__ __device__ -zip_iterator make_zip_iterator(IteratorTuple t); +zip_iterator> make_zip_iterator(thrust::tuple t); + + +/*! \p make_zip_iterator creates a \p zip_iterator from + * iterators. + * + * \param its The iterators to copy. + * \return A newly created \p zip_iterator which zips the iterators. + * + * \see zip_iterator + */ +template +inline __host__ __device__ +zip_iterator> make_zip_iterator(Iterators... its); + /*! \} // end fancyiterators */