Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KokkosBlas::dot: Poor accuracy with float on Mac Clang causes Trilinos test failure #574

Closed
mhoemmen opened this issue Jan 22, 2020 · 7 comments

Comments

@mhoemmen
Copy link
Contributor

See trilinos/Trilinos#6633.

@ndellingwood
Copy link
Contributor

@mhoemmen would you submit a PR with your fix from the Trilinos PR?

mhoemmen pushed a commit to mhoemmen/kokkos-kernels that referenced this issue Jan 22, 2020
For vectors of `float`, the two-argument overload of KokkosBlas::dot
(that takes two vectors (rank-1 Views) as input, and returns the dot
product result as a scalar value on host) gets inaccurate results on
Mac Clang.  This commit fixes that overload of KokkosBlas::dot so that
if the dot product result type is float resp. complex<float>, the
function uses double resp. complex<double> as the type for
intermediate sums.

This change, when applied to Trilinos in Pull Request
trilinos/Trilinos#6634, fixes Trilinos issue
trilinos/Trilinos#6633.
@ndellingwood
Copy link
Contributor

If so I can test and will cherry-pick into the release candidate.

@mhoemmen
Copy link
Contributor Author

@ndellingwood #575 :-)

@mhoemmen
Copy link
Contributor Author

@ndellingwood I just fixed the base branch in that PR, btw.

@mhoemmen
Copy link
Contributor Author

@ndellingwood FYI I had forgotten to test a change for complex. I will fix it.

mhoemmen pushed a commit to mhoemmen/kokkos-kernels that referenced this issue Jan 23, 2020
For vectors of `float`, the two-argument overload of KokkosBlas::dot
(that takes two vectors (rank-1 Views) as input, and returns the dot
product result as a scalar value on host) gets inaccurate results on
Mac Clang.  This commit fixes that overload of KokkosBlas::dot so that
if the dot product result type is float resp. complex<float>, the
function uses double resp. complex<double> as the type for
intermediate sums.

This change, when applied to Trilinos in Pull Request
trilinos/Trilinos#6634, fixes Trilinos issue
trilinos/Trilinos#6633.
@mhoemmen
Copy link
Contributor Author

@ndellingwood I fixed it :-)

@ndellingwood
Copy link
Contributor

PR #575 merged, will be included in 3.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants