Skip to content

Commit

Permalink
Add device container specializations for the view type handling
Browse files Browse the repository at this point in the history
  • Loading branch information
niermann999 committed Oct 19, 2023
1 parent 77a8f7c commit d00967e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions core/include/detray/core/detail/container_views.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,20 @@ struct detail::has_view<const vecmem::vector<T>, void> : public std::true_type {
using type = dvector_view<const T>;
};

/// Specialization of the view getter for @c vecmem::device_vector
template <typename T>
struct detail::has_view<vecmem::device_vector<T>, void>
: public std::true_type {
using type = dvector_view<T>;
};

/// Specialization of the view getter for @c vecmem::device_vector
template <typename T>
struct detail::has_view<const vecmem::device_vector<T>, void>
: public std::true_type {
using type = dvector_view<const T>;
};

/// Specialized view for @c vecmem::jagged_vector containers
template <typename T>
using djagged_vector_view = vecmem::data::jagged_vector_view<T>;
Expand Down Expand Up @@ -205,6 +219,19 @@ struct detail::has_view<const vecmem::jagged_vector<T>, void>
using type = djagged_vector_view<const T>;
};

/// Specialization of the view getter for @c vecmem::jagged_device_vector
template <typename T>
struct detail::has_view<vecmem::jagged_device_vector<T>, void>
: public std::true_type {
using type = djagged_vector_view<T>;
};

/// Specialization of the view getter for @c vecmem::jagged_device_vector
template <typename T>
struct detail::has_view<const vecmem::jagged_device_vector<T>, void>
: public std::true_type {
using type = djagged_vector_view<const T>;
};
/// @}

} // namespace detray

0 comments on commit d00967e

Please sign in to comment.