KokkosGraph Merge Routines ########################## Defined in header: :code:`KokkosGraph_Merge.hpp` .. code:: c++ template KOKKOS_INLINE_FUNCTION void merge_into_thread(const CView& c, const AView& a, const BView& b); template KOKKOS_INLINE_FUNCTION void merge_into_team(const TeamMember& handle, const CView& c, const AView& a, const BView& b); template void merge_into(const ExecSpace& space, const CView& c, const AView& a, const BView& b); template void merge_into(const CView& c, const AView& a, const BView& b); template void resize_and_merge_into(const ExecSpace& space, CView& c, const AView& a, const BView& b); template void resize_and_merge_into(CView& c, const AView& a, const BView& b); template CView merge(const ExecSpace& space, const AView& a, const BView& b); template CView merge(const AView& a, const BView& b); These routines merge two ordered rank-1 inputs into a single ordered result. They preserve stability with respect to the input sequences and expose thread, team, and global interfaces. Use ``merge_into_*`` when the output storage is already available. Use ``resize_and_merge_into`` when the output should be resized automatically. Use ``merge`` when the routine should allocate and return the merged view. Parameters ========== :handle: Kokkos team handle used by the team overload. :space: execution space instance. :a, b: rank-1 ordered input views to merge. :c: rank-1 output view that stores the merged result. Type Requirements ----------------- - ``AView``, ``BView``, and ``CView`` must be rank-1 Kokkos views. - ``c.size()`` must equal ``a.size() + b.size()`` for the ``merge_into`` overloads. - The memory spaces of the inputs and output must be accessible from the selected execution space. - The input value types must support the ordering relation used by the merge. Notes ===== - The inputs are assumed to be sorted in nondecreasing order. - If one input is empty, the result is a copy of the other input. Example ======= .. code:: c++ #include #include using view_type = Kokkos::View; void example(const view_type& a, const view_type& b) { auto c = KokkosGraph::merge(a, b); (void)c; }