Пример #1
0
 PODMap<GlobalOrdinal> getPOD() const {
   PODMap<GlobalOrdinal> ret;
   ret.n=d_ids.size();
   ret.rows=const_cast<GlobalOrdinal*>(thrust::raw_pointer_cast(&d_rows[0]));
   ret.ids=const_cast<GlobalOrdinal*>(thrust::raw_pointer_cast(&d_ids[0]));
   return ret;
 }
Пример #2
0
 static bool same_size( const thrust::device_vector< T > &x , const thrust::device_vector< T > &y )
 {
     return x.size() == y.size();
 }
Пример #3
0
 static void resize( thrust::device_vector< T > &x , const thrust::device_vector< T > &y )
 {
     x.resize( y.size() );
 }
Пример #4
0
void print_cuda_vec(const thrust::device_vector<Scalar>& vec, const std::string& name)
{
  for(size_t i=0; i<vec.size(); ++i) {
    std::cout << name << "["<<i<<"]: " << vec[i] << std::endl;
  }
}