Skip to content

Commit

Permalink
Merge pull request #5057 from martin-frbg/issue5050
Browse files Browse the repository at this point in the history
Replace while loop in generic C/ZGEMM_BETA to avoid going out of bounds
  • Loading branch information
martin-frbg authored Jan 11, 2025
2 parents 30f7a41 + d91d4fa commit d74eb02
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions kernel/generic/zgemm_beta.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1,
c_offset = c;

if (beta_r == 0. && beta_i == 0.) {
j = n;
do {

for (j=n;j>0;j--) {
c_offset1 = c_offset;
c_offset += ldc;

Expand Down Expand Up @@ -88,13 +88,12 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1,
i--;
} while (i > 0);
}
j --;
} while (j > 0);
}

} else {

j = n;
do {

for (j=n;j>0;j--) {
c_offset1 = c_offset;
c_offset += ldc;

Expand Down Expand Up @@ -151,8 +150,7 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1,
i --;
} while (i > 0);
}
j --;
} while (j > 0);
}
}
return 0;
}

0 comments on commit d74eb02

Please sign in to comment.