From 8ca11c4bbdfe072a1cc78a7d5e9168b1e8bd5fba Mon Sep 17 00:00:00 2001 From: Guodong Xu Date: Fri, 15 May 2020 05:26:10 +0000 Subject: [PATCH] trmm: fix up to make trmm tests run at designated steps Without this change, trmm test steps don't follow what specified by the caller. Also fix a bug in Makefile about test_dtrmm. Signed-off-by: Guodong Xu --- Makefile | 2 +- trmm.c | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 9494d7d..435181d 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ UTIL := bl_test.o MFLAGS := PREF := -Double_Tests := test_ddot test_drot test_daxpy test_dscal test_dasum test_dcopy test_dswap test_idamax test_idamin test_dgemm test_trmm +Double_Tests := test_ddot test_drot test_daxpy test_dscal test_dasum test_dcopy test_dswap test_idamax test_idamin test_dgemm test_dtrmm Float_Tests := $(foreach tests,$(Double_Tests), $(subst _id,_is,$(subst _d,_s,$(tests)))) Complex_Double_Tests := $(foreach tests,$(Double_Tests), $(subst _id,_iz,$(subst _d,_z,$(tests)))) Complex_Float_Tests := $(foreach tests,$(Double_Tests), $(subst _id,_ic,$(subst _d,_c,$(tests)))) diff --git a/trmm.c b/trmm.c index daa4572..62bdda7 100644 --- a/trmm.c +++ b/trmm.c @@ -49,11 +49,6 @@ int main(int argc, char* argv[]) { - fprintf(stderr, - "From : %3d To : %3d Step = %3d Side = %c Uplo = %c Trans = %c Diag " - "= %c\n", - from, to, step, side, uplo, trans, diag); - argc--; argv++; @@ -100,6 +95,12 @@ int main(int argc, char* argv[]) { n = to; } + fprintf(stderr, + "From : %3d To : %3d Step = %3d Side = %c Uplo = %c Trans = %c Diag " + "= %c\n", + from, to, step, side, uplo, trans, diag); + + if ( side=='L') { k = m; } @@ -148,10 +149,6 @@ int main(int argc, char* argv[]) { } for (i = from; i <= to; i += step) { - - - - if (!has_param_m) { m = i; } @@ -213,12 +210,14 @@ int main(int argc, char* argv[]) { } } else{ - for (i = 0; i < (k + lc_add) * (n + lc_add) * COMPSIZE; i++) { - b[i] = bi[i]; - bref[i] = bi[i]; + for (j = 0; j < (k + lc_add) * (n + lc_add) * COMPSIZE; j++) { + b[j] = bi[j]; + bref[j] = bi[j]; } } + fprintf(stderr, " M=%4d, N=%4d, lda=%4d, ldb=%4d, alpha[0]=%f: \n", (int) m, (int) n, lda, ldb, alpha[0]); + TRMM(&side, &uplo, &trans, &diag, &m, &n, alpha, a, &lda, b, &ldb); #ifndef COMPLEX