From 146beeda596cbf49e57a42b50861cf1f5cde49f2 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 20 Aug 2026 22:30:45 +0200 Subject: [PATCH 1/2] Ensure a safe margin between work arrays in the buffer even with small GEMM_R --- lapack/potrf/potrf_L_single.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lapack/potrf/potrf_L_single.c b/lapack/potrf/potrf_L_single.c index 0edadf3213..b781e048db 100644 --- a/lapack/potrf/potrf_L_single.c +++ b/lapack/potrf/potrf_L_single.c @@ -68,7 +68,7 @@ static FLOAT dm1 = -1.; #define GEMM_PQ MAX(GEMM_P, GEMM_Q) //leave some space for GEMM_ALIGN in sb2 -#define REAL_GEMM_R (GEMM_R - 2*GEMM_PQ) +#define REAL_GEMM_R (MAX(GEMM_R, GEMM_PQ + 96) - GEMM_PQ) #if 0 #define SHARED_ARRAY From 0944e9e7c1c90289521725c6478db55a454d4467 Mon Sep 17 00:00:00 2001 From: Martin Kroeker Date: Thu, 20 Aug 2026 22:32:08 +0200 Subject: [PATCH 2/2] Ensure a safe margin between work arrays in the buffer even when GEMM_PQR is small --- lapack/potrf/potrf_U_single.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lapack/potrf/potrf_U_single.c b/lapack/potrf/potrf_U_single.c index 932e481147..361db8fb9d 100644 --- a/lapack/potrf/potrf_U_single.c +++ b/lapack/potrf/potrf_U_single.c @@ -66,7 +66,7 @@ static FLOAT dm1 = -1.; #endif #define GEMM_PQ MAX(GEMM_P, GEMM_Q) -#define REAL_GEMM_R (GEMM_R - GEMM_PQ) +#define REAL_GEMM_R (MAX(GEMM_R, GEMM_PQ + 96) - GEMM_PQ) #if 0 #define SHARED_ARRAY