~ubuntu-branches/ubuntu/trusty/libthrust/trusty

« back to all changes in this revision

Viewing changes to detail/dispatch/set_operations.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Beckmann
  • Date: 2011-05-28 09:32:48 UTC
  • Revision ID: james.westby@ubuntu.com-20110528093248-np3euv5sj7fw3nyv
Tags: upstream-1.4.0
ImportĀ upstreamĀ versionĀ 1.4.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright 2008-2011 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
#pragma once
 
18
 
 
19
#include <thrust/set_operations.h>
 
20
#include <thrust/detail/host/set_operations.h>
 
21
#include <thrust/detail/device/set_operations.h>
 
22
 
 
23
namespace thrust
 
24
{
 
25
 
 
26
namespace detail
 
27
{
 
28
 
 
29
namespace dispatch
 
30
{
 
31
 
 
32
 
 
33
template<typename InputIterator1,
 
34
         typename InputIterator2,
 
35
         typename OutputIterator,
 
36
         typename StrictWeakOrdering>
 
37
  OutputIterator set_difference(InputIterator1 first1,
 
38
                                InputIterator1 last1,
 
39
                                InputIterator2 first2,
 
40
                                InputIterator2 last2,
 
41
                                OutputIterator result,
 
42
                                StrictWeakOrdering comp,
 
43
                                thrust::host_space_tag)
 
44
{
 
45
  return thrust::detail::host::set_difference(first1,last1,first2,last2,result,comp);
 
46
} // end set_difference()
 
47
 
 
48
 
 
49
template<typename InputIterator1,
 
50
         typename InputIterator2,
 
51
         typename OutputIterator,
 
52
         typename StrictWeakOrdering>
 
53
  OutputIterator set_difference(InputIterator1 first1,
 
54
                                InputIterator1 last1,
 
55
                                InputIterator2 first2,
 
56
                                InputIterator2 last2,
 
57
                                OutputIterator result,
 
58
                                StrictWeakOrdering comp,
 
59
                                thrust::device_space_tag)
 
60
{
 
61
  return thrust::detail::device::set_difference(first1,last1,first2,last2,result,comp);
 
62
} // end set_difference()
 
63
 
 
64
 
 
65
template<typename InputIterator1,
 
66
         typename InputIterator2,
 
67
         typename OutputIterator,
 
68
         typename StrictWeakOrdering>
 
69
  OutputIterator set_intersection(InputIterator1 first1,
 
70
                                  InputIterator1 last1,
 
71
                                  InputIterator2 first2,
 
72
                                  InputIterator2 last2,
 
73
                                  OutputIterator result,
 
74
                                  StrictWeakOrdering comp,
 
75
                                  thrust::device_space_tag)
 
76
{
 
77
  return thrust::detail::device::set_intersection(first1,last1,first2,last2,result,comp);
 
78
} // end set_intersection()
 
79
 
 
80
template<typename InputIterator1,
 
81
         typename InputIterator2,
 
82
         typename OutputIterator,
 
83
         typename StrictWeakOrdering>
 
84
  OutputIterator set_intersection(InputIterator1 first1,
 
85
                                  InputIterator1 last1,
 
86
                                  InputIterator2 first2,
 
87
                                  InputIterator2 last2,
 
88
                                  OutputIterator result,
 
89
                                  StrictWeakOrdering comp,
 
90
                                  thrust::host_space_tag)
 
91
{
 
92
  return thrust::detail::host::set_intersection(first1,last1,first2,last2,result,comp);
 
93
} // end set_intersection()
 
94
 
 
95
template<typename InputIterator1,
 
96
         typename InputIterator2,
 
97
         typename OutputIterator,
 
98
         typename StrictWeakOrdering>
 
99
  OutputIterator set_symmetric_difference(InputIterator1 first1,
 
100
                                          InputIterator1 last1,
 
101
                                          InputIterator2 first2,
 
102
                                          InputIterator2 last2,
 
103
                                          OutputIterator result,
 
104
                                          StrictWeakOrdering comp,
 
105
                                          thrust::host_space_tag)
 
106
{
 
107
  return thrust::detail::host::set_symmetric_difference(first1,last1,first2,last2,result,comp);
 
108
} // end set_symmetric_difference()
 
109
 
 
110
 
 
111
template<typename InputIterator1,
 
112
         typename InputIterator2,
 
113
         typename OutputIterator,
 
114
         typename StrictWeakOrdering>
 
115
  OutputIterator set_symmetric_difference(InputIterator1 first1,
 
116
                                          InputIterator1 last1,
 
117
                                          InputIterator2 first2,
 
118
                                          InputIterator2 last2,
 
119
                                          OutputIterator result,
 
120
                                          StrictWeakOrdering comp,
 
121
                                          thrust::device_space_tag)
 
122
{
 
123
  return thrust::detail::device::set_symmetric_difference(first1,last1,first2,last2,result,comp);
 
124
} // end set_symmetric_difference()
 
125
 
 
126
 
 
127
template<typename InputIterator1,
 
128
         typename InputIterator2,
 
129
         typename OutputIterator,
 
130
         typename StrictWeakOrdering>
 
131
  OutputIterator set_union(InputIterator1 first1,
 
132
                           InputIterator1 last1,
 
133
                           InputIterator2 first2,
 
134
                           InputIterator2 last2,
 
135
                           OutputIterator result,
 
136
                           StrictWeakOrdering comp,
 
137
                           thrust::host_space_tag)
 
138
{
 
139
  return thrust::detail::host::set_union(first1,last1,first2,last2,result,comp);
 
140
} // end set_union()
 
141
 
 
142
 
 
143
template<typename InputIterator1,
 
144
         typename InputIterator2,
 
145
         typename OutputIterator,
 
146
         typename StrictWeakOrdering>
 
147
  OutputIterator set_union(InputIterator1 first1,
 
148
                           InputIterator1 last1,
 
149
                           InputIterator2 first2,
 
150
                           InputIterator2 last2,
 
151
                           OutputIterator result,
 
152
                           StrictWeakOrdering comp,
 
153
                           thrust::device_space_tag)
 
154
{
 
155
  return thrust::detail::device::set_union(first1,last1,first2,last2,result,comp);
 
156
} // end set_union()
 
157
 
 
158
 
 
159
} // end dispatch
 
160
 
 
161
} // end detail
 
162
 
 
163
} // end thrust
 
164