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

Break possible deadlock on lockstep execution #819

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fel-cab
Copy link
Collaborator

@fel-cab fel-cab commented May 14, 2024

Some of the target_requires_atomic tests get on infinite loop with LLVM/Clang compiler because lockstep execution on the target device and the if-else order of execution. These tests are written assuming that target threads are independent or that if they execute in a warp, in lockstep execution, the order of execution would be first the if part and then the else part.
The modifications on the tests are meant to make sure that this problem does not happens for LLVM/Clang or any compiler that could encounter this problem.

@fel-cab fel-cab added 5.0 Related to spec version 5.0 ready PR is ready for review bug fix Fixes a bug in a test or the suite labels May 14, 2024
@fel-cab fel-cab self-assigned this May 14, 2024
@fel-cab fel-cab removed the ready PR is ready for review label May 23, 2024
@fel-cab
Copy link
Collaborator Author

fel-cab commented Jul 23, 2024

The following Issue was created for LLVM issues llvm/llvm-project#94047
Given the conclusion by the developers. I think this PR should be closed, but the problem with LLVM will always remain. The original code doesn't pass on LLVM either.

This code cannot reliably work. You are trying to synchronize within a warp on an AMDGPU, that does not work. OpenMP 6.0 makes this explicit. If you want to test atomics, split the reader and writer into different warps at least.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.0 Related to spec version 5.0 bug fix Fixes a bug in a test or the suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant