2 * Copyright 2008-2013 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.
18 /*! \file device_ptr.inl
19 * \brief Inline file for device_ptr.h.
22 #include <thrust/device_ptr.h>
23 #include <thrust/device_reference.h>
26 #include <thrust/detail/type_traits.h>
27 #include <thrust/iterator/iterator_traits.h>
33 device_ptr<T> device_pointer_cast(T *ptr)
35 return device_ptr<T>(ptr);
36 } // end device_pointer_cast()
39 device_ptr<T> device_pointer_cast(const device_ptr<T> &ptr)
42 } // end device_pointer_cast()
45 template<class E, class T, class Y>
46 std::basic_ostream<E, T> &operator<<(std::basic_ostream<E, T> &os, const device_ptr<Y> &p)
56 struct is_device_ptr< thrust::device_ptr<T> >
59 }; // end is_device_ptr
61 #if (THRUST_HOST_COMPILER == THRUST_HOST_COMPILER_MSVC) && (_MSC_VER <= 1400)
62 // XXX WAR MSVC 2005 problem with correctly implementing
63 // pointer_raw_pointer for device_ptr by specializing it here
65 struct pointer_raw_pointer< thrust::device_ptr<T> >
67 typedef typename device_ptr<T>::raw_pointer type;
68 }; // end pointer_raw_pointer
72 } // end namespace detail
73 } // end namespace thrust