From 2891fd8d6df7d634374ee46743deb96da130ab52 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Wed, 8 Jan 2025 23:17:45 +0100 Subject: [PATCH 1/3] Replace while loop with for --- kernel/generic/zgemm_beta.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/generic/zgemm_beta.c b/kernel/generic/zgemm_beta.c index 7954e22e3c..bf836aa3e1 100644 --- a/kernel/generic/zgemm_beta.c +++ b/kernel/generic/zgemm_beta.c @@ -93,8 +93,8 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, } else { - j = n; - do { + + for (j=n;j>0;j++) { c_offset1 = c_offset; c_offset += ldc; @@ -151,8 +151,7 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, i --; } while (i > 0); } - j --; - } while (j > 0); + } } return 0; } From 09e75f158897eb0310512b28851c15729a86d427 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 9 Jan 2025 00:52:14 +0100 Subject: [PATCH 2/3] fix absurd typo --- kernel/generic/zgemm_beta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/generic/zgemm_beta.c b/kernel/generic/zgemm_beta.c index bf836aa3e1..1f1ffe1237 100644 --- a/kernel/generic/zgemm_beta.c +++ b/kernel/generic/zgemm_beta.c @@ -94,7 +94,7 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, } else { - for (j=n;j>0;j++) { + for (j=n;j>0;j--) { c_offset1 = c_offset; c_offset += ldc; From d91d4fa6e94ef3f4a50c577b3cb5c191e4bc9e5c Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 9 Jan 2025 23:11:26 +0100 Subject: [PATCH 3/3] convert the beta=0 branch to a for loop as well --- kernel/generic/zgemm_beta.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/generic/zgemm_beta.c b/kernel/generic/zgemm_beta.c index 1f1ffe1237..61dd207d0c 100644 --- a/kernel/generic/zgemm_beta.c +++ b/kernel/generic/zgemm_beta.c @@ -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; @@ -88,8 +88,7 @@ int CNAME(BLASLONG m, BLASLONG n, BLASLONG dummy1, i--; } while (i > 0); } - j --; - } while (j > 0); + } } else {