我尝试编译
#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,但我得到以下 'hello.cpp:19:17: 错误:折叠的循环不完全嵌套' 这是什么意思?