提交记录 16132
提交时间 |
评测时间 |
2021-04-04 11:30:25 |
2021-04-04 11:30:32 |
#define idx(i, j) ((i) * n + (j))
void matrix_multiply(int n, const double *A, const double *B, double *C) {
for (int i = 0; i < n; i ++)
for (int j = 0; j < n; 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 | 3 s | 8 MB + 8 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2024-04-27 08:06:33 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用