Fix for iterator swap issues (GitHub issues and
GitHub
GitHub
Bug
Bug
git-commit
git-author Andrew Corrigan
VDVS:
Jobs:
[git-p4: depot-paths = "//sw/gpgpu/thrust/": change = 24262216]
MODIFY
thrust/detail/device_reference.inl
thrust/detail/device_reference.inl
@@ -46,7 +46,7 @@ template<typename T>
template<typename T>
__host__ __device__
-void swap(device_reference<T> &a, device_reference<T> &b)
+void swap(device_reference<T> a, device_reference<T> b)
{
a.swap(b);
} // end swap()

MODIFY
thrust/device_reference.h
thrust/device_reference.h
@@ -958,7 +958,7 @@ template<typename T>
*/
template<typename T>
__host__ __device__
-void swap(device_reference<T> &x, device_reference<T> &y);
+void swap(device_reference<T> x, device_reference<T> y);
// declare these methods for the purpose of Doxygenating them
// they actually are defined for a derived-from class

MODIFY
thrust/iterator/detail/tuple_of_iterator_references.h
thrust/iterator/detail/tuple_of_iterator_references.h
@@ -241,6 +241,20 @@ template<
};
+// this overload of swap() permits swapping tuple_of_iterator_references returned as temporaries from
+// iterator dereferences
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9,
+ typename U0, typename U1, typename U2, typename U3, typename U4, typename U5, typename U6, typename U7, typename U8, typename U9
+>
+inline __host__ __device__
+void swap(tuple_of_iterator_references<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> x,
+ tuple_of_iterator_references<U0,U1,U2,U3,U4,U5,U6,U7,U8,U9> y)
+{
+ x.swap(y);
+}
+
+
} // end detail
} // end thrust

Fix for iterator swap issues (GitHub issues #725 and #850)
GitHub #725
GitHub #850
Bug 2004661
Bug 1865408
git-commit 12d41520cf89d5f641988359d076204e07c22bdf
git-author Andrew Corrigan <andrew.corrigan@gmail.com>
VDVS: http://ausdvs.nvidia.com/Build_Results?virtualId=1000169424&which_page=current_build

Jobs: 1865408-2006 2004661-2006
[git-p4: depot-paths = "//sw/gpgpu/thrust/": change = 24262216]