Run AMP C++ kernel thread per row

49 views Asked by At

How to run AMP C++ kernel with thread per row? I got NxN matrix and want only N threads, not thread per element. But parallel_for_each(res.extent) accept only that, What should I pass instead of res.extent where res is NxN matrix?

1

There are 1 answers

7
GuillemVS On BEST ANSWER

You can create an extent by yourself with the size of one dimension of the matrix (since both are equal it doesn't matter which you pick).

using namespace concurrency;
parallel_for_each(extent<1>(res.extent[0]), function);

Then make sure you use index<1>.