34 #include <cugar/basic/types.h> 35 #include <cugar/basic/vector_view.h> 36 #include <thrust/host_vector.h> 37 #include <thrust/device_vector.h> 68 template <
typename T,
typename Alloc>
69 T*
raw_pointer(thrust::device_vector<T,Alloc>& vec) {
return vec.size() ? thrust::raw_pointer_cast( &vec.front() ) : NULL; }
73 template <
typename T,
typename Alloc>
74 const T*
raw_pointer(
const thrust::device_vector<T,Alloc>& vec) {
return vec.size() ? thrust::raw_pointer_cast( &vec.front() ) : NULL; }
79 T*
raw_pointer(thrust::host_vector<T>& vec) {
return vec.size() ? thrust::raw_pointer_cast( &vec.front() ) : NULL; }
84 const T*
raw_pointer(
const thrust::host_vector<T>& vec) {
return vec.size(), vec.size() ? thrust::raw_pointer_cast( &vec.front() ) : NULL; }
89 typename thrust::device_vector<T>::iterator
begin(thrust::device_vector<T>& vec) {
return vec.begin; }
94 typename thrust::device_vector<T>::const_iterator
begin(
const thrust::device_vector<T>& vec) {
return vec.begin; }
99 typename thrust::host_vector<T>::iterator
begin(thrust::host_vector<T>& vec) {
return vec.begin; }
103 template <
typename T>
104 typename thrust::host_vector<T>::const_iterator
begin(
const thrust::host_vector<T>& vec) {
return vec.begin; }
thrust::device_vector< T >::iterator begin(thrust::device_vector< T > &vec)
Definition: thrust_view.h:89
Definition: vector_view.h:87
vector_view< T *, uint64 > plain_view(thrust::device_vector< T > &vec)
Definition: thrust_view.h:49
T * raw_pointer(thrust::device_vector< T, Alloc > &vec)
Definition: thrust_view.h:69
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38