diff --git a/core/include/detray/utils/ranges/ranges.hpp b/core/include/detray/utils/ranges/ranges.hpp index 51e3f735a..e29c2acc7 100644 --- a/core/include/detray/utils/ranges/ranges.hpp +++ b/core/include/detray/utils/ranges/ranges.hpp @@ -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(*this); } + DETRAY_HOST_DEVICE constexpr auto cast_impl() const -> const view_impl_t& { return static_cast(*this); } @@ -318,7 +320,8 @@ class view_interface : public base_view { std::enable_if_t, 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>(i)]; } /// Subscript operator that takes detray @c dindex