提交记录 20101
提交时间 |
评测时间 |
2023-09-04 23:27:11 |
2023-09-04 23:27:14 |
#include <cstdint>
using namespace std;
template <size_t L, size_t M, size_t N>
struct MatMulKernel
{
enum
{
row1 = L,
col1 = M,
row2 = M,
col2 = N
};
template <typename Ty>
static void matmul(const Ty *A, const Ty *B, Ty *C)
{
for (size_t j = 0; j < col1; j++)
{
for (size_t i = 0; i < row1; i++)
{
Ty A_ij = A[i * col1 + j];
for (size_t k = 0; k < col2; k++)
{
C[i * col2 + k] += B[j * col2 + k] * A_ij;
}
}
}
}
};
void matrix_multiply(int n, const double *A, const double *B, double *C) {
MatMulKernel<1024,1024,1024>::matmul(A,B,C);
}
Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
Testcase #1 | 734.574 ms | 8 MB + 8 KB | Accepted | Score: 100 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2025-09-14 00:11:05 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠