Skip to content

Commit c171b8a

Browse files
authored
Handle special case INCX=0,INCY=0 in the axpy interface
1 parent 76a66ea commit c171b8a

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

interface/axpy.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ void CNAME(blasint n, FLOAT alpha, FLOAT *x, blasint incx, FLOAT *y, blasint inc
7575

7676
if (alpha == ZERO) return;
7777

78+
if (incx == 0 && incy == 0) {
79+
*y += n * alpha *(*x);
80+
return;
81+
}
82+
7883
IDEBUG_START;
7984

8085
FUNCTION_PROFILE_START();

interface/zaxpy.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ void CNAME(blasint n, FLOAT *ALPHA, FLOAT *x, blasint incx, FLOAT *y, blasint in
8282

8383
if ((alpha_r == ZERO) && (alpha_i == ZERO)) return;
8484

85+
if (incx == 0 && incy == 0) {
86+
*y += n * (alpha_r * (*x) - alpha_i* (*(x+1)) );
87+
*(y+1) += n * (alpha_i * (*x) + alpha_r * (*(x +1)) );
88+
return;
89+
}
90+
8591
IDEBUG_START;
8692

8793
FUNCTION_PROFILE_START();

0 commit comments

Comments
 (0)