1 /*
2  *  Copyright 2008-2013 NVIDIA Corporation
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  */
16 
17 
18 #pragma once
19 
20 #include <thrust/detail/config.h>
21 #include <thrust/system/detail/generic/tag.h>
22 
23 namespace thrust
24 {
25 namespace system
26 {
27 namespace detail
28 {
29 namespace generic
30 {
31 
32 
33 // XXX calling this function is an error; there is no implementation
34 template<typename DerivedPolicy,
35          typename InputIterator1,
36          typename InputIterator2,
37          typename OutputIterator,
38          typename StrictWeakOrdering>
39 __host__ __device__
40   OutputIterator merge(thrust::execution_policy<DerivedPolicy> &exec,
41                        InputIterator1 first1,
42                        InputIterator1 last1,
43                        InputIterator2 first2,
44                        InputIterator2 last2,
45                        OutputIterator result,
46                        StrictWeakOrdering comp);
47 
48 
49 template<typename DerivedPolicy,
50          typename InputIterator1,
51          typename InputIterator2,
52          typename OutputIterator>
53 __host__ __device__
54   OutputIterator merge(thrust::execution_policy<DerivedPolicy> &exec,
55                        InputIterator1 first1,
56                        InputIterator1 last1,
57                        InputIterator2 first2,
58                        InputIterator2 last2,
59                        OutputIterator result);
60 
61 
62 template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename InputIterator3, typename InputIterator4, typename OutputIterator1, typename OutputIterator2, typename Compare>
63 __host__ __device__
64   thrust::pair<OutputIterator1,OutputIterator2>
65     merge_by_key(thrust::execution_policy<DerivedPolicy> &exec,
66                  InputIterator1 keys_first1, InputIterator1 keys_last1,
67                  InputIterator2 keys_first2, InputIterator2 keys_last2,
68                  InputIterator3 values_first1, InputIterator4 values_first2,
69                  OutputIterator1 keys_result,
70                  OutputIterator2 values_result,
71                  Compare comp);
72 
73 
74 template<typename DerivedPolicy, typename InputIterator1, typename InputIterator2, typename InputIterator3, typename InputIterator4, typename OutputIterator1, typename OutputIterator2>
75 __host__ __device__
76   thrust::pair<OutputIterator1,OutputIterator2>
77     merge_by_key(thrust::execution_policy<DerivedPolicy> &exec,
78                  InputIterator1 keys_first1, InputIterator1 keys_last1,
79                  InputIterator2 keys_first2, InputIterator2 keys_last2,
80                  InputIterator3 values_first1, InputIterator4 values_first2,
81                  OutputIterator1 keys_result,
82                  OutputIterator2 values_result);
83 
84 
85 } // end namespace generic
86 } // end namespace detail
87 } // end namespace system
88 } // end namespace thrust
89 
90 #include <thrust/system/detail/generic/merge.inl>
91 
92