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

cub::DeviceRadixSor works with a hack: #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

qezlou
Copy link
Collaborator

@qezlou qezlou commented Oct 24, 2024

  • Code compiles and a test in tests/cuv_sort.cu outputs a correct answer

HACK: combined Topkey, key into a single unit64_t.

  • This is to avoid using a struct with two uint32_t members. Which is not supported by cub::DeviceRadixSort::SortPairs.
  • TODO: use thrust::sort_by_key instead of cub::DeviceRadixSort::SortPairs

return child;
}

/* Remove garbage particles, holes in sph chunk, and holes in bh buffer.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this function and the functions it calls from this file: no need to port it to gpu.

if (!SLOTS_ENABLED(ptype, sman))
continue;
// Sort the used ones by their location in the P array
qsort_openmp(sman->info[ptype].ptr,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we port this to cub::DeviceRadixSort as well?

- Code compiles and a test in tests/cuv_sort.cu outputs a correct answer

HACK: combined Topkey, key into a single unit64_t.
- This is to avoid using a struct with two uint32_t members. Which is not supported by cub::DeviceRadixSort::SortPairs.
- TODO: use `thrust::sort_by_key` instead of `cub::DeviceRadixSort::SortPairs`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants