Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Sep 20, 2024
1 parent 47cd674 commit ecf2e3b
Show file tree
Hide file tree
Showing 2 changed files with 1,315 additions and 342 deletions.
31 changes: 1 addition & 30 deletions src/layer/arm/gemm_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6160,21 +6160,6 @@ int Gemm_arm::forward_int8(const std::vector<Mat>& bottom_blobs, std::vector<Mat
// 1xN
broadcast_type_C = 4;
}

// pre-multiply C with beta
if (beta != 1.f)
{
Mat CT_data;
CT_data.create_like(C, opt.workspace_allocator);

const int size = C.total() * C.elempack;
for (int i = 0; i < size; i++)
{
CT_data[i] = C[i] * beta;
}

C = CT_data;
}
}
}

Expand Down Expand Up @@ -6242,22 +6227,8 @@ int Gemm_arm::forward_int8(const std::vector<Mat>& bottom_blobs, std::vector<Mat
const Mat& B = bottom_blobs[1];
ret = gemm_arm_int8(A, B, C, top_blob, broadcast_type_C, transA, transB, output_transpose, constant_TILE_M, constant_TILE_N, constant_TILE_K, _nT, opt);
}
if (ret != 0)
return ret;

// multiply top_blob with alpha
if (alpha != 1.f)
{
const int size = top_blob.total() * out_elempack;

#pragma omp parallel for num_threads(opt.num_threads)
for (int i = 0; i < size; i++)
{
top_blob[i] *= alpha;
}
}

return 0;
return ret;
}
#endif

Expand Down
Loading

0 comments on commit ecf2e3b

Please sign in to comment.