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 device declarations for HIP compilation and use DETRAY_NO_DEVICE consistently #951

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

StewMH
Copy link
Contributor

@StewMH StewMH commented Mar 13, 2025

Missing some if defined(__HIP__): since DETRAY_NO_DEVICE defines these, use it consistently instead.

@@ -23,8 +23,7 @@ template <std::random_access_iterator rand_iter_t,
std::sentinel_for<rand_iter_t> sentinel_t>
DETRAY_HOST_DEVICE inline void sequential_sort(rand_iter_t first,
sentinel_t last) {
#if defined(__CUDACC__) || defined(CL_SYCL_LANGUAGE_VERSION) || \
defined(SYCL_LANGUAGE_VERSION)
#if !defined(DETRAY_NO_DEVICE)
Copy link
Member

Choose a reason for hiding this comment

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

Nitpick, but for readability could we do the following?

#ifdef DETRAY_NO_DEVICE
std::ranges::sort(first, last);
#else
detray::detail::selection_sort(first, last);
#endif

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