提交 5c658f7e 编写于 作者: Z zhaojiaying01

fix gemm Sgemm_omp when bias = nullptr

上级 8e9fffa9
...@@ -3307,9 +3307,14 @@ void Gemm::Sgemm_omp(int m, int n, int k, float alpha, const float *A, int lda, ...@@ -3307,9 +3307,14 @@ void Gemm::Sgemm_omp(int m, int n, int k, float alpha, const float *A, int lda,
float *local_A = packedA + MC * KC * local_threads; float *local_A = packedA + MC * KC * local_threads;
float *local_C = packedC + MC * NC * local_threads; float *local_C = packedC + MC * NC * local_threads;
(*this.*procPackA)(mc, KC, mc % MR, &A(i, 0), lda, local_A); (*this.*procPackA)(mc, KC, mc % MR, &A(i, 0), lda, local_A);
if (bias == nullptr) {
InnerKernelWithBias(mc, n, alpha, local_A, packedB, beta, local_C,
&C(i, 0), ldc, relu, nullptr);
} else {
InnerKernelWithBias(mc, n, alpha, local_A, packedB, beta, local_C, InnerKernelWithBias(mc, n, alpha, local_A, packedB, beta, local_C,
&C(i, 0), ldc, relu, bias + i); &C(i, 0), ldc, relu, bias + i);
} }
}
} else { } else {
#pragma omp parallel for #pragma omp parallel for
for (int j = 0; j < n; j += NC) { for (int j = 0; j < n; j += NC) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册