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

128-bit CAS without Assembly Broken? #161

Closed
nmhamster opened this issue Dec 19, 2015 · 2 comments
Closed

128-bit CAS without Assembly Broken? #161

nmhamster opened this issue Dec 19, 2015 · 2 comments
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@nmhamster
Copy link
Contributor

If I comment out the assembly version of the 128-bit CAS loop and compile with OpenMP tests fail on X86 systems with GNU and Intel. Not sure but the fall-back may be broken which could have impact on other platforms.

@nmhamster nmhamster added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Dec 19, 2015
@crtrott
Copy link
Member

crtrott commented Dec 19, 2015

Ok I think this was only in pull request #160

The problem is that the use of cas128 was only protected by "if defined(KOKKOS_ENABLE_ASM)" while the contents of cas128 with the changes in the pull request were now protected by
"if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_USE_ISA_X86_64 )".
That way the 128 cas which got called was actually not atomic, which made the tests fail since the cas loops never finished.
I changed it so that the whole function is not visible anymore (not just the loop body) if those two things are not defined, and I protected the use of cas128 with both defines everywhere.

So now if either KOKKOS_ENABLE_ASM or KOKKOS_USE_ISA_X86_64 is not defined 128 bit atomics go to the generic backend.

@crtrott crtrott closed this as completed Dec 19, 2015
@nmhamster
Copy link
Contributor Author

?Great thanks!

S.

Simon Hammond
Center for Computing Research (Scalable Computer Architectures)
Sandia National Laboratories, NM
[Sent from remote connection, please excuse typing errors]


From: Christian Trott notifications@github.com
Sent: Saturday, December 19, 2015 3:36 PM
To: kokkos/kokkos
Cc: Hammond, Simon David (-EXP)
Subject: [EXTERNAL] Re: [kokkos] 128-bit CAS without Assembly Broken? (#161)

Ok I think this was only in pull request #160#160

The problem is that the use of cas128 was only protected by "if defined(KOKKOS_ENABLE_ASM)" while the contents of cas128 with the changes in the pull request were now protected by
"if defined(KOKKOS_ENABLE_ASM) && defined ( KOKKOS_USE_ISA_X86_64 )".
That way the 128 cas which got called was actually not atomic, which made the tests fail since the cas loops never finished.
I changed it so that the whole function is not visible anymore (not just the loop body) if those two things are not defined, and I protected the use of cas128 with both defines everywhere.

So now if either KOKKOS_ENABLE_ASM or KOKKOS_USE_ISA_X86_64 is not defined 128 bit atomics go to the generic backend.

Reply to this email directly or view it on GitHubhttps://github.com//issues/161#issuecomment-166031241.

@crtrott crtrott self-assigned this Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

2 participants