Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix raft::bitonic_sort small usage example #1580

Merged
merged 4 commits into from
Jun 10, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix raft::bitonic_sort small usage example
  • Loading branch information
enp1s0 committed Jun 7, 2023
commit 642e9c75bbc210f80ae3c534f80a78686e2b35f8
12 changes: 6 additions & 6 deletions cpp/include/raft/util/bitonic_sort.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ _RAFT_DEVICE _RAFT_FORCEINLINE void conditional_assign(bool cond, T& ptr, T x)
* 3 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 48 49 50 ...
* `
*
* Here is a small usage example of device code, which sorts the arrays of length 6 (= 3 * 2)
* Here is a small usage example of device code, which sorts the arrays of length 8 (= 4 * 2)
* grouped in pairs of threads in ascending order:
* @code{.cpp}
* // Fill an array of three ints in each thread of a warp.
* // Fill an array of four ints in each thread of a warp.
* int i = laneId();
* int arr[3] = {i+1, i+5, i};
* int arr[4] = {i+1, i+5, i, i+7};
* // Sort the arrays in groups of two threads.
* bitonic<3>(ascending=true, warp_width=2).sort(arr);
* bitonic<4>(ascending=true, warp_width=2).sort(arr);
* // As a result,
* // for every even thread (`i == 2j`): arr == {2j, 2j+1, 2j+5}
* // for every odd thread (`i == 2j+1`): arr == {2j+1, 2j+2, 2j+6}
* // for every even thread (`i == 2j`): arr == {2j, 2j+1, 2j+5, 2j+7}
* // for every odd thread (`i == 2j+1`): arr == {2j+1, 2j+2, 2j+6, 2j+8}
* @endcode
*
* @tparam Size
Expand Down