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
Open
Changes from all commits
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
21 changes: 9 additions & 12 deletions core/include/detray/definitions/algorithms.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ 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)
detray::detail::selection_sort(first, last);
#else
#if defined(DETRAY_NO_DEVICE)
std::ranges::sort(first, last);
#else
detray::detail::selection_sort(first, last);
#endif
}

Expand All @@ -50,11 +49,10 @@ template <std::forward_iterator forw_iter_t,
std::sentinel_for<forw_iter_t> sentinel_t, typename Value>
DETRAY_HOST_DEVICE inline auto lower_bound(forw_iter_t first, sentinel_t last,
const Value& value) {
#if defined(__CUDACC__) || defined(CL_SYCL_LANGUAGE_VERSION) || \
defined(SYCL_LANGUAGE_VERSION)
return detray::detail::lower_bound(first, last, value);
#else
#if defined(DETRAY_NO_DEVICE)
return std::ranges::lower_bound(first, last, value);
#else
return detray::detail::lower_bound(first, last, value);
#endif
}

Expand All @@ -63,11 +61,10 @@ template <std::forward_iterator forw_iter_t,
std::sentinel_for<forw_iter_t> sentinel_t, typename Value>
DETRAY_HOST_DEVICE inline auto upper_bound(forw_iter_t first, sentinel_t last,
const Value& value) {
#if defined(__CUDACC__) || defined(CL_SYCL_LANGUAGE_VERSION) || \
defined(SYCL_LANGUAGE_VERSION)
return detray::detail::upper_bound(first, last, value);
#else
#if defined(DETRAY_NO_DEVICE)
return std::ranges::upper_bound(first, last, value);
#else
return detray::detail::upper_bound(first, last, value);
#endif
}

Expand Down
Loading