Skip to content

Commit 4e2c14c

Browse files
committed
OSX: Use cblas interface for *dot blas functions
Using the documented cblas_*dot interface for the *dot BLAS functions on OSX (using the Accelerate framework) will give the expected result in contrast do using *dot_ functions.
1 parent dbe7741 commit 4e2c14c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/tests/correctness/blas-lapack.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,20 @@ void zdscal( int n, double alpha, doublecomplex *x, int incx)
630630

631631
float sdot( int n, float *x, int incx, float *y, int incy)
632632
{
633+
#ifdef __APPLE__
634+
return cblas_sdot(n, x, incx, y, incy);
635+
#else
633636
return sdot_(&n, x, &incx, y, &incy);
637+
#endif
634638
}
635639

636640
double ddot( int n, double *x, int incx, double *y, int incy)
637641
{
642+
#ifdef __APPLE__
643+
return cblas_ddot(n, x, incx, y, incy);
644+
#else
638645
return ddot_(&n, x, &incx, y, &incy);
646+
#endif
639647
}
640648

641649
complex cdotu( int n, complex *x, int incx, complex *y, int incy)

0 commit comments

Comments
 (0)