-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[OpenACC] Implement initial parsing for parallel
construct
#72661
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
01fc81b
[OpenACC] Implement initial parsing for Construct/Directive Names
erichkeane b76ab0f
Clang Format fix
erichkeane 12f6205
Merge remote-tracking branch 'erichkeane/main' into OpenACC_Parse_Con…
erichkeane 57d9e5f
Reduce implementation to base infra + parallel parsing
erichkeane File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//===--- OpenACCKinds.h - OpenACC Enums -------------------------*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
/// | ||
/// \file | ||
/// Defines some OpenACC-specific enums and functions. | ||
/// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef LLVM_CLANG_BASIC_OPENACCKINDS_H | ||
#define LLVM_CLANG_BASIC_OPENACCKINDS_H | ||
|
||
namespace clang { | ||
// Represents the Construct/Directive kind of a pragma directive. Note the | ||
// OpenACC standard is inconsistent between calling these Construct vs | ||
// Directive, but we're calling it a Directive to be consistent with OpenMP. | ||
enum class OpenACCDirectiveKind { | ||
// Compute Constructs. | ||
Parallel, | ||
|
||
// Invalid. | ||
Invalid, | ||
}; | ||
} // namespace clang | ||
|
||
#endif // LLVM_CLANG_BASIC_OPENACCKINDS_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %clang_cc1 %s -verify -fopenacc | ||
|
||
void func() { | ||
// expected-error@+2{{invalid OpenACC directive 'invalid'}} | ||
// expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
#pragma acc invalid | ||
for(;;){} | ||
|
||
// expected-warning@+2{{OpenACC clause parsing not yet implemented}} | ||
// expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
#pragma acc parallel clause list | ||
for(;;){} | ||
// expected-warning@+2{{OpenACC clause parsing not yet implemented}} | ||
// expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
#pragma acc parallel() clause list | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest starting with a single construct support, say parallel. Other constructs must be added later, when each particular feature is going to be implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our implementation strategy is to start with all of the 'parsing' first, starting at constructs, I don't see why this is an issue? I understand the grammar enough that this seems valid.
At this point, we HAVE successfully implemented parsing for all of the 'non-optional-parens' versions.
Doing it this way permits us to do the implementation of clauses next: clauses in OpenACC are shared between all of the constructs, so implementing 1 construct at a time would prevent us from being able to do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify: Are you asking me to split this patch up into 23 different ones here? The first adding the infrastructure + parallel, followed by most of the 22 that are just adding an entry here and to a string-switch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not neccesary. The first patch, that lands main infrastructure, better to have a small parsing functionality, the future patch(es) may include parsing of other stuff, if it small enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright then, I'll do that.