コンパイルしてみます
#include <omp.h>
using namespace std;
vector< vector<int> > multiplyMatrixes(const vector< vector<int> > &a, const vector< vector<int> > &b, int aHeight, int aWidth, int bHeight, int bWidth) {
vector < vector<int> > c(aHeight, vector<int>(bWidth, 0));
#pragma omp parallel for collapse(2)
for(int row = 0; row < aHeight; row++) {
for(int col = 0; col < bWidth; col++) {
int value = 0;
for(int i = 0; i < aWidth; i++) {
value += a[row][i] * b[i][col];
}
c[row][col] = value;
cout<<"Tread #"<<omp_get_thread_num()<<"\n";
}
std::cout<<'\n';
}
return c;
}
int main() {}
'g ++ -fopenmp hello.cpp -o hello'コマンドを使用すると、gccバージョンは4.7ですが、次のようになります。