Skip to content

Commit

Permalink
Call begin explicitly in ranges view interface (#655)
Browse files Browse the repository at this point in the history
Silence CUDA errors
  • Loading branch information
niermann999 authored Feb 7, 2024
1 parent 8e6f055 commit 867205c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/include/detray/utils/ranges/ranges.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ class view_interface : public base_view {

/// Cast to the implementation type to access its methods
/// @{
DETRAY_HOST_DEVICE
constexpr auto cast_impl() -> view_impl_t& {
return static_cast<view_impl_t&>(*this);
}
DETRAY_HOST_DEVICE
constexpr auto cast_impl() const -> const view_impl_t& {
return static_cast<const view_impl_t&>(*this);
}
Expand Down Expand Up @@ -318,7 +320,8 @@ class view_interface : public base_view {
std::enable_if_t<detray::ranges::random_access_range_v<R>, bool> = true>
DETRAY_HOST_DEVICE constexpr decltype(auto) operator[](
const dindex i) const {
return (detray::ranges::cbegin(cast_impl()))
// Call 'begin()' directly here to make CUDA happy
return (cast_impl().begin())
[static_cast<detray::ranges::range_difference_t<R>>(i)];
}
/// Subscript operator that takes detray @c dindex
Expand Down

0 comments on commit 867205c

Please sign in to comment.