libatlas3gf-sse2 zgemv function gives wrong result
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
atlas (Debian) |
Fix Released
|
Unknown
|
|||
atlas (Ubuntu) |
Fix Released
|
High
|
Morten Kjeldgaard |
Bug Description
Binary package hint: libatlas3gf-sse2
The blas matrix-vector complex product is completely broken if using sse2 even for very small matrix.
The consequences for lapack, python numpy.linalg functions, etc. are catastrophic.
Here a very simple t.f FORTRAN program showing the bug
program sse2_bug
complex*16 cmone
complex*16 a(2,2)
complex*16 x(2)
complex*16 y(2)
cmone = (1.,0.)
a(1,1) = (1.,0.)
a(2,1) = (0.,0.)
a(1,2) = (0.,0.)
a(2,2) = (1.,0.)
x(1) = (0.,3.)
x(2) = (1.,0.)
y(1) = (0.,0.)
y(2) = (1.,0.)
call zgemv('
write(*,*) y(1)," == 3j"
end
Compilation :
gfortran -o t t.f -lblas
Buggy lib:
ldd ./t | grep libblas.so
libblas.so.3gf => /usr/lib/
./t
( 0.0000000000000000 ,-1.25759005142
Non-sse2 libs give correct result:
(export LD_LIBRARY_
( 0.0000000000000000 , 3.0000000000000000 ) == 3j
(export LD_LIBRARY_
( 0.0000000000000000 , 3.0000000000000000 ) == 3j
Description: Ubuntu 9.04
Release: 9.04
libatlas3gf-sse2:
Installed: 3.6.0-22ubuntu2
Candidate: 3.6.0-22ubuntu2
Version table:
*** 3.6.0-22ubuntu2 0
500 http://
100 /var/lib/
Related branches
Changed in atlas (Ubuntu): | |
assignee: | nobody → Morten Kjeldgaard (mok0) |
Changed in atlas (Debian): | |
status: | Unknown → New |
Changed in atlas (Debian): | |
status: | New → Fix Released |
Changed in atlas (Ubuntu): | |
status: | Confirmed → Fix Released |
An simpler program, same output:
program sse2_bug n',1,1, cmone,a, 1,x,1,cmone, y,1)
complex*16 cmone
complex*16 a(2)
complex*16 x
complex*16 y
cmone = (1.,0.)
a(1) = (1.,0.)
a(2) = (0.,0.)
x = (0.,3.)
y = (0.,0.)
call zgemv('
write(*,*) y," == 3j"
end