Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6956 Discussions

Numerical differences in DGELSS between identical calls

davidjward30
Beginner
403 Views
When calling DGELSS multiple times with the same arguments, I find that the results of the FIRST call differ ever so slightly from subsequent calls which are all indentical. Typically, the differences are in the last couple of digits.

I have not found such problems with any other MKL functions.

I am using MKL7.0 on Windows XP Pro, Pentium IV 3Ghz. Visual C++ 7.1

Perhaps MKL is altering the floating point precision via the _controlfp / control87 functions?


Thanks.

David.
0 Kudos
3 Replies
TimP
Honored Contributor III
403 Views
Assuming that you are using the P4 library, are you passing data with identical alignments? If not, supposing that you are declaring your data in C, try __declspec(align 16) declarations.
0 Kudos
davidjward30
Beginner
403 Views
Hi.

Yes I'm using the P4 kernel. I'm also developing in C++.

The data and workspace are in new'ed arrays - which are not always 16 bit aligned. When I replaced the new with an _aligned_malloc the problem disappeared.

Thanks for your help.

David.
0 Kudos
TimP
Honored Contributor III
403 Views
David,

Yes, I think the MKL documents mention the possibility of better performance with aligned arguments, but perhaps not the possibility of slightly different round-off where mis-alignment requires more serial operations. Glad to hear that you found a reasonable solution.

Tim
0 Kudos
Reply