void operator()( const tbb::concurrent_vector<int>::range_type& range ) const {
     for( iterator i=range.begin(); i!=range.end(); ++i ) {
         if( *i!=0 )
             std::printf("ERROR for v[%ld]\n", long(i-base));
         *i = int(i-base);
     }
 }
示例#2
0
文件: Vector.hpp 项目: amart/ATL
        Vector(const Vector &orig)
        : isize(orig.isize) {
            this->isize = orig.isize;
            data_m.resize(orig.data_m.size());
#if defined(ATL_CONCURRENCY_ENABLED)
            for (int i = 0; i < data_m.size(); i++) {
                data_m[i] = orig.data_m[i];
            }
#else
            data_m.insert(data_m.begin(), orig.data_m.begin(), orig.data_m.end());
#endif
        }
示例#3
0
文件: Vector.hpp 项目: amart/ATL
        Vector& operator=(const Vector &other) {
            this->isize = other.isize;
            data_m.resize(other.data_m.size());
#if defined(ATL_CONCURRENCY_ENABLED)
            for (int i = 0; i < data_m.size(); i++) {
                data_m[i] = other.data_m[i];
            }
#else
            data_m.insert(data_m.begin(), other.data_m.begin(), other.data_m.end());
#endif
            return *this;
        }
 void operator()( const tbb::concurrent_vector<int>::const_range_type& range ) const {
     for( iterator i=range.begin(); i!=range.end(); ++i )
         if( *i != int(i-base) )
             REPORT("ERROR for v[%ld]\n", long(i-base));
 }
示例#5
0
void MR::do_sort(tbb::concurrent_vector<Pair> &vec) {
  tbb::parallel_sort(vec.begin(), vec.end(), compare);
}