Егор Лебедев
Егор Лебедев

Reputation: 1336

Run AMP C++ kernel thread per row

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?

Upvotes: 0

Views: 52

Answers (1)

GuillemVS
GuillemVS

Reputation: 366

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>.

Upvotes: 1

Related Questions