36 #include <thrust/host_vector.h>
37 #include <thrust/device_vector.h>
80 T*
raw_pointer(thrust::device_vector<T>& vec) {
return vec.size() ? thrust::raw_pointer_cast( &vec.front() ) : NULL; }
85 const T*
raw_pointer(
const thrust::device_vector<T>& vec) {
return vec.size() ? thrust::raw_pointer_cast( &vec.front() ) : NULL; }
90 T*
raw_pointer(thrust::host_vector<T>& vec) {
return vec.size() ? thrust::raw_pointer_cast( &vec.front() ) : NULL; }
95 const T*
raw_pointer(
const thrust::host_vector<T>& vec) {
return vec.size(), vec.size() ? thrust::raw_pointer_cast( &vec.front() ) : NULL; }
100 typename thrust::device_vector<T>::iterator
begin(thrust::device_vector<T>& vec) {
return vec.begin; }
104 template <
typename T>
105 typename thrust::device_vector<T>::const_iterator
begin(
const thrust::device_vector<T>& vec) {
return vec.begin; }
109 template <
typename T>
110 typename thrust::host_vector<T>::iterator
begin(thrust::host_vector<T>& vec) {
return vec.begin; }
114 template <
typename T>
115 typename thrust::host_vector<T>::const_iterator
begin(
const thrust::host_vector<T>& vec) {
return vec.begin; }