Skip to content

Commit f84197c

Browse files
authored
Add shortcuts for (small) cases that do not need expensive buffer allocation
1 parent 734bd26 commit f84197c

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

interface/trsv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo,
188188

189189
if (n == 0) return;
190190

191+
if (incx == 1 && trans == 0 && n < 50) {
192+
buffer = NULL;
193+
(trsv[(trans<<2) | (uplo<<1) | unit])(n, a, lda, x, incx, buffer);
194+
return;
195+
}
196+
191197
IDEBUG_START;
192198

193199
FUNCTION_PROFILE_START();

interface/ztrsv.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,12 @@ void CNAME(enum CBLAS_ORDER order, enum CBLAS_UPLO Uplo,
199199

200200
if (n == 0) return;
201201

202+
if (incx == 1 && trans == 0 && n < 50) {
203+
buffer = NULL;
204+
(trsv[(trans<<2) | (uplo<<1) | unit])(n, a, lda, x, incx, buffer);
205+
return;
206+
}
207+
202208
IDEBUG_START;
203209

204210
FUNCTION_PROFILE_START();

0 commit comments

Comments
 (0)