Browse Source

fix gemm x86 transpose b pack4 mis-alignment

tags/20230223
nihui GitHub 3 years ago
parent
commit
2f8d1d4f9e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/layer/x86/gemm_x86.cpp

+ 5
- 5
src/layer/x86/gemm_x86.cpp View File

@@ -1577,7 +1577,7 @@ static void transpose_pack_B_tile(const Mat& B, Mat& BT, int j, int max_jj, int
#endif // __AVX__
if (elempack == 4)
{
const float* p0 = (const float*)B + k * B_hstep + (j + jj) * 4;
const float* p0 = (const float*)B + k / 4 * 4 * B_hstep + (j + jj) * 4;

int kk = 0;
for (; kk + 3 < max_kk; kk += 4)
@@ -1692,7 +1692,7 @@ static void transpose_pack_B_tile(const Mat& B, Mat& BT, int j, int max_jj, int
#endif // __AVX__
if (elempack == 4)
{
const float* p0 = (const float*)B + k * B_hstep + (j + jj) * 4;
const float* p0 = (const float*)B + k / 4 * 4 * B_hstep + (j + jj) * 4;

int kk = 0;
for (; kk + 3 < max_kk; kk += 4)
@@ -1781,7 +1781,7 @@ static void transpose_pack_B_tile(const Mat& B, Mat& BT, int j, int max_jj, int
#endif // __AVX__
if (elempack == 4)
{
const float* p0 = (const float*)B + k * B_hstep + (j + jj) * 4;
const float* p0 = (const float*)B + k / 4 * 4 * B_hstep + (j + jj) * 4;

int kk = 0;
for (; kk + 3 < max_kk; kk += 4)
@@ -1854,7 +1854,7 @@ static void transpose_pack_B_tile(const Mat& B, Mat& BT, int j, int max_jj, int
#endif // __AVX__
if (elempack == 4)
{
const float* p0 = (const float*)B + k * B_hstep + (j + jj) * 4;
const float* p0 = (const float*)B + k / 4 * 4 * B_hstep + (j + jj) * 4;

int kk = 0;
for (; kk + 3 < max_kk; kk += 4)
@@ -1917,7 +1917,7 @@ static void transpose_pack_B_tile(const Mat& B, Mat& BT, int j, int max_jj, int
#endif // __AVX__
if (elempack == 4)
{
const float* p0 = (const float*)B + k * B_hstep + (j + jj) * 4;
const float* p0 = (const float*)B + k / 4 * 4 * B_hstep + (j + jj) * 4;

int kk = 0;
for (; kk + 3 < max_kk; kk += 4)


Loading…
Cancel
Save