Skip to content

Commit 0e2cb97

Browse files
committed
Ensure the CUDA radix sort backend synchronizes before returning; otherwise,
copies from temporary storage will race with destruction of said temporary storage. NVC++ FS #28463 Reviewed-By: David Olsen <dolsen@nvidia.com>
1 parent 691b021 commit 0e2cb97

File tree

1 file changed

+4
-0
lines changed
  • thrust/system/cuda/detail

1 file changed

+4
-0
lines changed

thrust/system/cuda/detail/sort.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,6 +1598,10 @@ namespace __smart_sort {
15981598
{
15991599
cuda_cub::copy(policy, keys.begin(), keys.end(), keys_first);
16001600
}
1601+
1602+
cuda_cub::throw_on_error(
1603+
cuda_cub::synchronize(policy),
1604+
"merge_sort: failed to synchronize");
16011605
}
16021606
} // namespace __smart_sort
16031607

0 commit comments

Comments
 (0)