38 #include <thrust/host_vector.h>
39 #include <thrust/device_vector.h>
46 template<
typename TTargetVector,
typename TSourceVector>
47 static NVBIO_FORCEINLINE void thrust_copy_vector(TTargetVector& target, TSourceVector& source)
49 if (target.size() != source.size())
52 target.resize(source.size());
55 thrust::copy(source.begin(), source.end(), target.begin());
58 template<
typename TTargetVector,
typename TSourceVector>
61 if (target.size() != count)
67 thrust::copy(source.begin(), source.begin() + count, target.begin());
74 template <
typename system_tag,
typename T>
98 vector<host_tag,T>& operator= (
const thrust::host_vector<T>& v) { cuda::thrust_copy_vector( *
this, v );
return *
this; }
99 vector<host_tag,T>& operator= (
const thrust::device_vector<T>& v) { cuda::thrust_copy_vector( *
this, v );
return *
this; }
112 template <
typename T>
131 vector<device_tag,T>& operator= (
const thrust::host_vector<T>& v) { cuda::thrust_copy_vector( *
this, v );
return *
this; }
132 vector<device_tag,T>& operator= (
const thrust::device_vector<T>& v) { cuda::thrust_copy_vector( *
this, v );
return *
this; }
151 template <
typename T>