Skip to content

Commit d4380c1

Browse files
committed
Refs xianyi/OpenBLAS-CI#10 , Fix sdot for scipy test_iterative.test_convergence test failure on AMD bulldozer and piledriver.
1 parent 7282419 commit d4380c1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

kernel/x86_64/sdot.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,20 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
7272
{
7373
BLASLONG i=0;
7474
BLASLONG ix=0,iy=0;
75+
double dot = 0.0 ;
7576

76-
FLOAT dot = 0.0 ;
77+
FLOAT mydot=0.0;
78+
BLASLONG n1;
7779

7880
if ( n <= 0 ) return(dot);
7981

8082
if ( (inc_x == 1) && (inc_y == 1) )
8183
{
8284

83-
BLASLONG n1 = n & -32;
85+
n1 = n & (BLASLONG)(-32);
8486

8587
if ( n1 )
86-
sdot_kernel_16(n1, x, y , &dot );
88+
sdot_kernel_16(n1, x, y , &mydot );
8789

8890

8991
i = n1;
@@ -94,12 +96,13 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
9496
i++ ;
9597

9698
}
99+
dot+=mydot;
97100
return(dot);
98101

99102

100103
}
101104

102-
BLASLONG n1 = n & -2;
105+
n1 = n & (BLASLONG)(-2);
103106

104107
while(i < n1)
105108
{
@@ -124,4 +127,3 @@ FLOAT CNAME(BLASLONG n, FLOAT *x, BLASLONG inc_x, FLOAT *y, BLASLONG inc_y)
124127

125128
}
126129

127-

0 commit comments

Comments
 (0)