From f41dedd024fe394b0fc4cdd5f5cbe75e10b626ac Mon Sep 17 00:00:00 2001 From: Joana Niermann Date: Thu, 19 Oct 2023 10:52:27 +0200 Subject: [PATCH] Add device container specializations for the view type handling --- .../detray/core/detail/container_views.hpp | 27 +++++++++++++++++++ core/include/detray/core/detector.hpp | 9 +++++++ 2 files changed, 36 insertions(+) diff --git a/core/include/detray/core/detail/container_views.hpp b/core/include/detray/core/detail/container_views.hpp index e49ccae978..2837f546ac 100644 --- a/core/include/detray/core/detail/container_views.hpp +++ b/core/include/detray/core/detail/container_views.hpp @@ -175,6 +175,20 @@ struct detail::has_view, void> : public std::true_type { using type = dvector_view; }; +/// Specialization of the view getter for @c vecmem::device_vector +template +struct detail::has_view, void> + : public std::true_type { + using type = dvector_view; +}; + +/// Specialization of the view getter for @c vecmem::device_vector +template +struct detail::has_view, void> + : public std::true_type { + using type = dvector_view; +}; + /// Specialized view for @c vecmem::jagged_vector containers template using djagged_vector_view = vecmem::data::jagged_vector_view; @@ -205,6 +219,19 @@ struct detail::has_view, void> using type = djagged_vector_view; }; +/// Specialization of the view getter for @c vecmem::jagged_device_vector +template +struct detail::has_view, void> + : public std::true_type { + using type = djagged_vector_view; +}; + +/// Specialization of the view getter for @c vecmem::jagged_device_vector +template +struct detail::has_view, void> + : public std::true_type { + using type = djagged_vector_view; +}; /// @} } // namespace detray diff --git a/core/include/detray/core/detector.hpp b/core/include/detray/core/detector.hpp index 9dbcd43915..10d06c3118 100644 --- a/core/include/detray/core/detector.hpp +++ b/core/include/detray/core/detector.hpp @@ -131,6 +131,9 @@ class detector { typename surface_container::view_type, dvector_view, typename volume_finder::view_type>; + static_assert(detail::is_device_view_v, + "Detector view type ill-formed"); + using const_view_type = dmulti_view, typename transform_container::const_view_type, @@ -140,6 +143,9 @@ class detector { dvector_view, typename volume_finder::const_view_type>; + static_assert(detail::is_device_view_v, + "Detector const view type ill-formed"); + /// Detector buffer types using buffer_type = dmulti_buffer< dvector_buffer, typename transform_container::buffer_type, @@ -148,6 +154,9 @@ class detector { typename surface_container::buffer_type, dvector_buffer, typename volume_finder::buffer_type>; + static_assert(detail::is_buffer_v, + "Detector buffer type ill-formed"); + detector() = delete; // The detector holds a lot of data and should never be copied detector(const detector &) = delete;