sgaure

acml 4.4.0 ifort - Incorrect NaN handling in DGEMM

Discussion created by sgaure on Nov 9, 2010
The handling of NaNs in DGEMM has changed between 4.1.0 and 4.4.0

The code in http://folk.uio.no/sgaure/tcross.f90 is a f90 version of the tcrossprod test in the tests directory of R-2.12.0 (reg-tests-1b.R, heading "## most likely indicates an inaedquate BLAS.")

It produces 0 instead of NaN for an entry (2. row, 3. column) of a particular matrix product (a NaN*0 case).  Linking with acml 4.1.0 (same executable, different LD_LIBRARY_PATH) produces the correct NaN value.

The library in question is ifort64 on a linux system.

Are there any workarounds for this behaviour?  (R is quite standardized w.r.t. NaN-handling, this behaviour is unfortunate).

Outcomes