今天有点时间,给大家一个实验数据:(the performance results are similar from TBB and OpenMP. However there is no critical section in this example - unnecessary. TBB has other powerful functions)
今天有点时间,给大家一个实验数据:(the performance results are similar from TBB and OpenMP. However there is no critical section in this example - unnecessary. TBB has other powerful functions)
距阵乘法原型:
// C = A x B
void SerialMatrixMultiply (float c[N][N], float a[N][N], float b[N][N]) {
for (size_t i = 0; i < N; ++i ) {
for (size_t j = 0; j < N; ++j ) {
float sum = 0;
for (size_t k = 0; k < N; ++k ) {
sum += a[i][k]*b[k][j];
}
c[i][j] = sum;
}
}
}