diff --git a/tests/threads.cpp b/tests/threads.cpp index b8c0e6620..63c31200a 100644 --- a/tests/threads.cpp +++ b/tests/threads.cpp @@ -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 q(1, queue); vex::vector x(q, n); x = 1; vex::Reductor 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;