thrust
Modules | Functions
Memory Management Functions

Modules

 Deallocation Functions
 
 Allocation Functions
 

Functions

template<typename T >
__host__ __device__ device_ptr< T > thrust::device_pointer_cast (T *ptr)
 
template<typename T >
__host__ __device__ device_ptr< T > thrust::device_pointer_cast (const device_ptr< T > &ptr)
 
template<typename Pointer >
__host__ __device__
thrust::detail::pointer_traits
< Pointer >::raw_pointer 
thrust::raw_pointer_cast (const Pointer &ptr)
 
template<typename T >
__host__ __device__
detail::raw_reference< T >
::type 
thrust::raw_reference_cast (T &ref)
 
template<typename T >
__host__ __device__
detail::raw_reference< const T >
::type 
thrust::raw_reference_cast (const T &ref)
 

Detailed Description

Function Documentation

template<typename T >
__host__ __device__ device_ptr<T> thrust::device_pointer_cast ( T *  ptr)
inline

device_pointer_cast creates a device_ptr from a raw pointer which is presumed to point to a location in device memory.

Parameters
ptrA raw pointer, presumed to point to a location in device memory.
Returns
A device_ptr wrapping ptr.
template<typename T >
__host__ __device__ device_ptr<T> thrust::device_pointer_cast ( const device_ptr< T > &  ptr)
inline

This version of device_pointer_cast creates a copy of a device_ptr from another device_ptr. This version is included for symmetry with raw_pointer_cast.

Parameters
ptrA device_ptr.
Returns
A copy of ptr.
template<typename Pointer >
__host__ __device__ thrust::detail::pointer_traits<Pointer>::raw_pointer thrust::raw_pointer_cast ( const Pointer &  ptr)
inline

raw_pointer_cast creates a "raw" pointer from a pointer-like type, simply returning the wrapped pointer, should it exist.

Parameters
ptrThe pointer of interest.
Returns
ptr.get(), if the expression is well formed; ptr, otherwise.
See Also
raw_reference_cast
template<typename T >
__host__ __device__ detail::raw_reference<T>::type thrust::raw_reference_cast ( T &  ref)
inline

raw_reference_cast creates a "raw" reference from a wrapped reference type, simply returning the underlying reference, should it exist.

If the argument is not a reference wrapper, the result is a reference to the argument.

Parameters
refThe reference of interest.
Returns
*thrust::raw_pointer_cast(&ref).
Note
There are two versions of raw_reference_cast. One for const references, and one for non-const.
See Also
raw_pointer_cast
template<typename T >
__host__ __device__ detail::raw_reference<const T>::type thrust::raw_reference_cast ( const T &  ref)
inline

raw_reference_cast creates a "raw" reference from a wrapped reference type, simply returning the underlying reference, should it exist.

If the argument is not a reference wrapper, the result is a reference to the argument.

Parameters
refThe reference of interest.
Returns
*thrust::raw_pointer_cast(&ref).
Note
There are two versions of raw_reference_cast. One for const references, and one for non-const.
See Also
raw_pointer_cast