提交记录 16133
提交时间 |
评测时间 |
2021-04-04 11:31:36 |
2021-04-04 11:31:43 |
#define idx(i, j) ((i) * n + (j))
void matrix_multiply(int n, const double *A, const double *B, double *C) {
const int BLOCK = 2;
for (int ii = 0; ii < n; ii += BLOCK)
for (int jj = 0; jj < n; jj += BLOCK)
for (int i = ii; i < ii + BLOCK; i ++)
for (int j = jj; j < jj + BLOCK; j ++)
{
double a_ij = A[idx(i, j)];
register double *c_i = C + i * n;
register const double *b_j = B + j * n;
const int UNROLL = 4;
for (int k = 0; k < n; k += UNROLL)
{
c_i[0] += a_ij * b_j[0];
c_i[1] += a_ij * b_j[1];
c_i[2] += a_ij * b_j[2];
c_i[3] += a_ij * b_j[3];
c_i += UNROLL;
b_j += UNROLL;
}
}
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 2.837 s | 8 MB + 8 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-10-05 12:05:39 | Loaded in 0 ms | Server Status
个人娱乐项目,仅供学习交流使用