add test case for zaxpy with incx=0 incy=1

This commit is contained in:
Martin Kroeker
2023-08-04 12:26:36 +02:00
committed by GitHub
parent 4664b57e6e
commit d64fa286f7

View File

@@ -74,6 +74,28 @@ CTEST(axpy,zaxpy_inc_0)
ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
}
}
CTEST(axpy,zaxpy_incx_0)
{
blasint i;
blasint N=4,incX=0,incY=1;
double a[2]={0.25,0.5};
double x1[]={1.0,3.0,5.0,7.0,1.0,3.0,5.0,7.0};
double y1[]={2.0,4.0,6.0,8.0,2.0,4.0,6.0,8.0};
double x2[]={1.0,3.0,5.0,7.0,1.0,3.0,5.0,7.0};
double y2[]={0.75,5.25,4.75,9.25,0.75,5.25,4.75,9.25};
//OpenBLAS
BLASFUNC(zaxpy)(&N,a,x1,&incX,y1,&incY);
for(i=0; i<2*N; i++){
//fprintf(stderr,"output X %lf\n",x1[i]);
//fprintf(stderr,"output Y %lf\n",y1[i]);
ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
}
}
#endif
#ifdef BUILD_SINGLE