Skip to content

Commit

Permalink
Deprecate cub::Swap (#3333)
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jan 10, 2025
1 parent 13b8f7c commit 6386d42
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cub/cub/thread/thread_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
CUB_NAMESPACE_BEGIN

template <typename T>
CCCL_DEPRECATED_BECAUSE("Use cuda::std::swap")
_CCCL_DEVICE _CCCL_FORCEINLINE void Swap(T& lhs, T& rhs)
{
T temp = lhs;
Expand Down Expand Up @@ -95,10 +96,11 @@ StableOddEvenSort(KeyT (&keys)[ITEMS_PER_THREAD], ValueT (&items)[ITEMS_PER_THRE
{
if (compare_op(keys[j + 1], keys[j]))
{
Swap(keys[j], keys[j + 1]);
using ::cuda::std::swap;
swap(keys[j], keys[j + 1]);
if (!KEYS_ONLY)
{
Swap(items[j], items[j + 1]);
swap(items[j], items[j + 1]);
}
}
} // inner loop
Expand Down

0 comments on commit 6386d42

Please sign in to comment.