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

Spir-V frontend #703

Merged
merged 160 commits into from
Aug 12, 2024
Merged

Spir-V frontend #703

merged 160 commits into from
Aug 12, 2024

Conversation

natgavrilenko
Copy link
Collaborator

No description provided.

Copy link
Owner

@hernanponcedeleon hernanponcedeleon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall comment, whenever you get assumptions (e.g., coming from the specification), document these things because they are no trivial for someone that needs to read the code and might not be an expert on spirv

benchmarks/opencl/caslock-sc.cl Show resolved Hide resolved
benchmarks/opencl/caslock-sc.cl Show resolved Hide resolved
benchmarks/opencl/caslock.cl Show resolved Hide resolved
dartagnan/pom.xml Show resolved Hide resolved
litmus/VULKAN/Manual/XF-Barrier.litmus Outdated Show resolved Hide resolved
litmus/VULKAN/Manual/cbar-2.litmus Outdated Show resolved Hide resolved
litmus/VULKAN/Manual/counter-atomic-load.litmus Outdated Show resolved Hide resolved
Comment on lines +147 to +151
} else if (succ instanceof ControlBarrier barrier) {
final Branch succBranch = computeBranchDecomposition(barrier.getSuccessor(), event2BranchMap, branches);
branch.children.add(succBranch);
succBranch.parents.add(branch);
return branch;
Copy link
Collaborator

@ThomasHaas ThomasHaas Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought of an alternative idea. Usually if we do not terminate, we still jump to the end of the thread.
The new ControlBarriers changes this fact which requires some updates here and there.
However, we could generate usual branching code like this:

E1: ControlBarrier(<id>)
E2: bool barrierNotExecuted = ExecutionStatus(E1) // Notice this returns TRUE if not executed
E3: if (barrierNotExecuted) goto END_OF_THREAD; ### EARLYTERMINATION

I.e., rather than giving control barriers special branching semantics, we just give them special execution semantics and then use standard branching on the execution semantics via a ExecutionStatus event.

This code could get fully generated at parsing time with the difference that the if-condition becomes an AbortIf(barrierNotExecuted) with Tag.EARLYTERMINATION.
As a consequence no code needs to get modified except the execution encoding of CBs and the stuckness encoding.

EDIT: I believe Tag.EARLYTERMINATION is misleading: we use it to mean both "nontermination" (spinloops, bound events, and soon control barriers(?)) and "irregular/exceptional termination" (assertion failure in C code).
We should probably split the tag into Tag.NONTERMINATION and Tag.IRREGULAR_TERMINATION.

EDIT 2: @hernanponcedeleon FYI, I implemented the above split in the executionModel branch.

Natalia Gavrilenko and others added 25 commits August 7, 2024 17:44
Signed-off-by: Hernan Ponce de Leon <[email protected]>
Signed-off-by: Hernan Ponce de Leon <[email protected]>
@hernanponcedeleon hernanponcedeleon merged commit 030b16b into development Aug 12, 2024
1 check passed
hernanponcedeleon pushed a commit that referenced this pull request Aug 28, 2024
Co-authored-by: Natalia Gavrilenko <[email protected]>
Co-authored-by: Hernan Ponce de Leon <[email protected]>
Co-authored-by: haining <[email protected]>
Co-authored-by: Thomas Haas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants