Skip to content

Commit

Permalink
Fix tests/threads
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed May 16, 2014
1 parent 7386a16 commit 99a9091
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/threads.cpp
Expand Up @@ -9,19 +9,19 @@ BOOST_AUTO_TEST_CASE(threads)
{
const size_t n = 1024 * 1024;

auto run = [n](vex::backend::command_queue queue, cl_long &s) {
auto run = [n](vex::backend::command_queue queue, cl_long *s) {
std::vector<vex::backend::command_queue> q(1, queue);
vex::vector<int> x(q, n);
x = 1;
vex::Reductor<cl_long, vex::SUM> sum(q);
s = sum(x);
*s = sum(x);
};

std::vector< boost::thread > threads;
std::vector< cl_long > results(ctx.size(), 0);

for(unsigned d = 0; d < ctx.size(); ++d) {
threads.push_back( boost::thread(run, ctx.queue(d), results[d]) );
threads.push_back( boost::thread(run, ctx.queue(d), &results[d]) );
}

cl_long sum = 0;
Expand Down

0 comments on commit 99a9091

Please sign in to comment.