Skip to content

Commit 3f1cc80

Browse files
Add comment about how to fix IterSwap and InsertionSort for SoA tracks
1 parent bbf78f2 commit 3f1cc80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

GPU/Common/GPUCommonAlgorithm.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class GPUCommonAlgorithm
7979
template <typename I>
8080
GPUdi() void GPUCommonAlgorithm::IterSwap(I a, I b) noexcept
8181
{
82-
auto tmp = *a;
82+
auto tmp = *a; // TODO: Fails with SoA tracks (segfault)! Fix by replacing auto by typename std::iterator_traits<I>::value_type
8383
*a = *b;
8484
*b = tmp;
8585
}
@@ -89,7 +89,7 @@ GPUdi() void GPUCommonAlgorithm::InsertionSort(I f, I l, Cmp cmp) noexcept
8989
{
9090
auto it0{f};
9191
while (it0 != l) {
92-
auto tmp{*it0};
92+
auto tmp{*it0}; // TODO: Fails with SoA tracks (segfault)! Fix by replacing auto by typename std::iterator_traits<I>::value_type
9393

9494
auto it1{it0};
9595
while (it1 != f && cmp(tmp, it1[-1])) {

0 commit comments

Comments
 (0)