2
* Copyright 2008-2012 NVIDIA Corporation
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
8
* http://www.apache.org/licenses/LICENSE-2.0
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.
19
#include <thrust/detail/config.h>
20
#include <thrust/detail/raw_pointer_cast.h>
21
#include <thrust/swap.h>
33
template<typename Pointer1, typename Pointer2>
34
inline __host__ __device__
35
void iter_swap(tag, Pointer1 a, Pointer2 b)
37
// XXX war nvbugs/881631
38
struct war_nvbugs_881631
40
__host__ inline static void host_path(Pointer1 a, Pointer2 b)
42
thrust::swap_ranges(a, a + 1, b);
45
__device__ inline static void device_path(Pointer1 a, Pointer2 b)
48
swap(*thrust::raw_pointer_cast(a),
49
*thrust::raw_pointer_cast(b));
54
return war_nvbugs_881631::host_path(a,b);
56
return war_nvbugs_881631::device_path(a,b);
57
#endif // __CUDA_ARCH__