Skip to content

Commit

Permalink
Merge pull request #5042 from tingboliao/develop
Browse files Browse the repository at this point in the history
Add the test cases of rot to improve the unit tests for rot_rvv.
  • Loading branch information
martin-frbg authored Jan 10, 2025
2 parents c31f148 + 14c72d6 commit 0b9de3e
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions utest/test_rot.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,23 @@ CTEST(rot,drot_inc_0)
ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
}
}
CTEST(rot,drot_inc_1)
{
blasint i=0;
blasint N=4,incX=1,incY=1;
double c=1.0,s=1.0;
double x1[]={1.0,3.0,5.0,7.0};
double y1[]={2.0,4.0,6.0,8.0};
double x2[]={3.0,7.0,11.0,15.0};
double y2[]={1.0,1.0,1.0,1.0};

BLASFUNC(drot)(&N,x1,&incX,y1,&incY,&c,&s);

for(i=0; i<N; i++){
ASSERT_DBL_NEAR_TOL(x2[i], x1[i], DOUBLE_EPS);
ASSERT_DBL_NEAR_TOL(y2[i], y1[i], DOUBLE_EPS);
}
}
#endif

#ifdef BUILD_COMPLEX16
Expand Down Expand Up @@ -96,6 +113,23 @@ CTEST(rot,srot_inc_0)
ASSERT_DBL_NEAR_TOL(y2[i], y1[i], SINGLE_EPS);
}
}
CTEST(rot,srot_inc_1)
{
blasint i=0;
blasint N=4,incX=1,incY=1;
float c=1.0,s=1.0;
float x1[]={1.0,3.0,5.0,7.0};
float y1[]={2.0,4.0,6.0,8.0};
float x2[]={3.0,7.0,11.0,15.0};
float y2[]={1.0,1.0,1.0,1.0};

BLASFUNC(srot)(&N,x1,&incX,y1,&incY,&c,&s);

for(i=0; i<N; i++){
ASSERT_DBL_NEAR_TOL(x2[i], x1[i], SINGLE_EPS);
ASSERT_DBL_NEAR_TOL(y2[i], y1[i], SINGLE_EPS);
}
}
#endif

#ifdef BUILD_COMPLEX
Expand Down

0 comments on commit 0b9de3e

Please sign in to comment.