Ensure the CUDA radix sort backend synchronizes before returning; otherwise,
copies from temporary storage will race with destruction of said temporary
storage.
NVC++ FS
MODIFY
thrust/system/cuda/detail/sort.h
thrust/system/cuda/detail/sort.h
@@ -1598,6 +1598,10 @@ namespace __smart_sort {
{
cuda_cub::copy(policy, keys.begin(), keys.end(), keys_first);
}
+
+ cuda_cub::throw_on_error(
+ cuda_cub::synchronize(policy),
+ "merge_sort: failed to synchronize");
}
} // namespace __smart_sort

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>