Skip to content

Commit d64fa28

Browse files
authored
add test case for zaxpy with incx=0 incy=1
1 parent 4664b57 commit d64fa28

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

utest/test_axpy.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,28 @@ CTEST(axpy,zaxpy_inc_0)
7474
ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
7575
}
7676
}
77+
78+
CTEST(axpy,zaxpy_incx_0)
79+
{
80+
blasint i;
81+
blasint N=4,incX=0,incY=1;
82+
double a[2]={0.25,0.5};
83+
double x1[]={1.0,3.0,5.0,7.0,1.0,3.0,5.0,7.0};
84+
double y1[]={2.0,4.0,6.0,8.0,2.0,4.0,6.0,8.0};
85+
double x2[]={1.0,3.0,5.0,7.0,1.0,3.0,5.0,7.0};
86+
double y2[]={0.75,5.25,4.75,9.25,0.75,5.25,4.75,9.25};
87+
88+
//OpenBLAS
89+
BLASFUNC(zaxpy)(&N,a,x1,&incX,y1,&incY);
90+
91+
for(i=0; i<2*N; i++){
92+
//fprintf(stderr,"output X %lf\n",x1[i]);
93+
//fprintf(stderr,"output Y %lf\n",y1[i]);
94+
ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
95+
ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
96+
}
97+
}
98+
7799
#endif
78100

79101
#ifdef BUILD_SINGLE

0 commit comments

Comments
 (0)