Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use std::launch::async

  • Loading branch information...
commit 6680d4673575b2f6d99be3d4bfe749ba85e64704 1 parent 148f774
@Neverlord Neverlord authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 cppa/matrix.cpp
View
4 cppa/matrix.cpp
@@ -158,7 +158,7 @@ matrix_type async_multiply(const matrix_type& lhs, const matrix_type& rhs) {
futures.reserve(matrix_size * matrix_size);
for (size_t row = 0; row < matrix_size; ++row) {
for (size_t column = 0; column < matrix_size; ++column) {
- futures.push_back(std::async(std::launch::deferred, [&,row,column] {
+ futures.push_back(std::async(std::launch::async, [&,row,column] {
result(row, column) = dot_product(lhs, rhs, row, column);
}));
}
@@ -172,7 +172,7 @@ matrix_type async_multiply2(const matrix_type& lhs, const matrix_type& rhs) {
vector<future<void>> futures;
futures.reserve(matrix_size);
for (size_t row = 0; row < matrix_size; ++row) {
- futures.push_back(std::async(std::launch::deferred, [&,row] {
+ futures.push_back(std::async(std::launch::async, [&,row] {
for (size_t column = 0; column < matrix_size; ++column) {
result(row, column) = dot_product(lhs, rhs, row, column);
}
Please sign in to comment.
Something went wrong with that request. Please try again.