Skip to content

Commit

Permalink
Allow passing generated kernel args for each GPU (#213)
Browse files Browse the repository at this point in the history
Kernel args packed into std::vector will be unpacked and passed
to the generated kernels on respective devices.

See #202
  • Loading branch information
ddemidov authored Oct 27, 2016
1 parent 12f0e32 commit 6578ce2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vexcl/generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,13 @@ class kernel {
}
}

template <class T>
void push_arg(const std::vector<T> &args) {
for(unsigned d = 0; d < queue.size(); d++) {
cache.find(backend::get_context_id(queue[d]))->second.push_arg(args[d]);
}
}

void operator()() {
for(unsigned d = 0; d < queue.size(); d++) {
auto &K = cache.find(backend::get_context_id(queue[d]))->second;
Expand Down

0 comments on commit 6578ce2

Please sign in to comment.