Changes

Jump to: navigation, search

GPU621/NoName

6 bytes added, 11:32, 24 November 2016
OpenMP code
//Workshop 3 using the scan and reduce with openMp
template <typename T, typename R, typename C, typename S> int scan(
const T* in, // source data
T* out, // output data
S scan_fn, // scan function (exclusive or inclusive)
T initial // initial value
) {
/* int tile size = (n - 1)/ntiles + 1;
reduced[tid] = reduce(in + tid * tilesize,itile == last_tile ? last_tile_size : tile_size, combine, T(0));
T* scanRes = new T[max_threads];
#pragma omp parallel
{
int ntiles = omp_get_num_threads(); // Number of tiles
}
return nthreads;
}
====C++11 code====
23
edits

Navigation menu