OSDN Git Service

CUDA
[eos/hostdependX86LINUX64.git] / util / X86LINUX64 / cuda-6.5 / include / thrust / system / cuda / detail / copy.inl
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 #include <thrust/detail/config.h>
18 #include <thrust/system/cuda/detail/copy.h>
19 #include <thrust/system/cuda/detail/copy_device_to_device.h>
20 #include <thrust/system/cuda/detail/copy_cross_system.h>
21
22 namespace thrust
23 {
24 namespace system
25 {
26 namespace cuda
27 {
28 namespace detail
29 {
30
31
32 template<typename System,
33          typename InputIterator,
34          typename OutputIterator>
35   OutputIterator copy(execution_policy<System> &system,
36                       InputIterator first,
37                       InputIterator last,
38                       OutputIterator result)
39 {
40   return thrust::system::cuda::detail::copy_device_to_device(system,first,last,result);
41 } // end copy()
42
43
44 template<typename System1,
45          typename System2,
46          typename InputIterator,
47          typename OutputIterator>
48   OutputIterator copy(cross_system<System1,System2> systems,
49                       InputIterator first,
50                       InputIterator last,
51                       OutputIterator result)
52 {
53   return thrust::system::cuda::detail::copy_cross_system(systems,first,last,result);
54 } // end copy()
55
56
57 template<typename System,
58          typename InputIterator,
59          typename Size,
60          typename OutputIterator>
61   OutputIterator copy_n(execution_policy<System> &system,
62                         InputIterator first,
63                         Size n,
64                         OutputIterator result)
65 {
66   return thrust::system::cuda::detail::copy_device_to_device(system,first,first+n,result);
67 } // end copy_n()
68
69
70 template<typename System1,
71          typename System2,
72          typename InputIterator,
73          typename Size,
74          typename OutputIterator>
75   OutputIterator copy_n(cross_system<System1,System2> systems,
76                         InputIterator first,
77                         Size n,
78                         OutputIterator result)
79 {
80   return thrust::system::cuda::detail::copy_cross_system_n(systems,first,n,result);
81 } // end copy_n()
82
83
84 } // end detail
85 } // end cuda
86 } // end system
87 } // end thrust
88