RandomAccessIterator2 reduce_intervals(RandomAccessIterator1 first, Decomposition decomp, RandomAccessIterator2 result, BinaryFunction binary_op) { typedef typename thrust::iterator_value<RandomAccessIterator2>::type result_type; const size_t groupsize = 128; size_t heap_size = groupsize * sizeof(result_type); bulk::async(bulk::grid<groupsize,7>(decomp.size(),heap_size), reduce_intervals_kernel(), bulk::root.this_exec, first, decomp, result, binary_op); return result + decomp.size(); } // end reduce_intervals()
__host__ __device__ RandomAccessIterator2 reduce_intervals_(execution_policy<DerivedPolicy> &exec, RandomAccessIterator1 first, Decomposition decomp, RandomAccessIterator2 result, BinaryFunction binary_op) { typedef typename thrust::iterator_value<RandomAccessIterator2>::type result_type; const size_t groupsize = 128; size_t heap_size = groupsize * sizeof(result_type); bulk_::async(bulk_::grid<groupsize,7>(decomp.size(),heap_size,stream(thrust::detail::derived_cast(exec))), reduce_intervals_detail::reduce_intervals_kernel(), bulk_::root.this_exec, first, decomp, result, binary_op); return result + decomp.size(); } // end reduce_intervals()
RandomAccessIterator2 reduce_intervals_(execution_policy<DerivedPolicy> &, RandomAccessIterator1 first, Decomposition decomp, RandomAccessIterator2 result, BinaryFunction binary_op) { namespace bulk_ = thrust::system::cuda::detail::bulk; typedef typename thrust::iterator_value<RandomAccessIterator2>::type result_type; const size_t groupsize = 128; size_t heap_size = groupsize * sizeof(result_type); bulk_::async(bulk_::grid<groupsize,7>(decomp.size(),heap_size), reduce_intervals_detail::reduce_intervals_kernel(), bulk_::root.this_exec, first, decomp, result, binary_op); return result + decomp.size(); } // end reduce_intervals()
bool MutationDelGoal::operator()( Decomposition & decompo ) { if( decompo.size() <= 1 ) { return false; } else { #ifndef NDEBUG eo::log << eo::debug << "D"; eo::log.flush(); eo::log << eo::xdebug << " DelGoal:" << std::endl << "\tBefore: "; simplePrint( eo::log << eo::xdebug, decompo ); #endif unsigned int i = rng.random( std::min( static_cast<unsigned int>(decompo.size()), static_cast<unsigned int>(decompo.last_reached() + 1) ) ); decompo.erase( decompo.iter_at( i ) ); #ifndef NDEBUG eo::log << eo::xdebug << "\tdelete the " << i << "th goal" << std::endl; eo::log << eo::xdebug << "\tAfter: "; simplePrint( eo::log << eo::xdebug, decompo ); #endif return true; } }