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

enums for the same OpenMP constants are defined in both ompparser and ROSETTA/SageIII #63

Open
yanyh15 opened this issue Nov 12, 2020 · 0 comments

Comments

@yanyh15
Copy link
Member

yanyh15 commented Nov 12, 2020

Please check this file:
https://github.com/passlab/rexompiler/blob/master/src/ROSETTA/src/node.C#L1925
For example, to initialize the IF clause, we specify a parameter with data type and variable name. The issue is ROSE only supports a limited number of data types to generate those huge CXX files. Even the very common std::vector can't be used directly as a parameter.

Those supported data types are defined in this file:
https://github.com/passlab/rexompiler/blob/master/src/ROSETTA/src/buildStorageClasses.C#L1664
This function "string AstNodeClass::buildSourceForIRNodeStorageClassConstructor ()" will encouter the assert failure if any new data type is used to declare the node parameter. Some other functions may be also involved.

Unparsing is more straight-forward.
https://github.com/passlab/rexompiler/blob/master/src/backend/unparser/languageIndependenceSupport/unparseLanguageIndependentConstructs.C

Another place need to be updated I know is omplowering.
https://github.com/passlab/rexompiler/blob/master/src/midend/programTransformation/ompLowering/omp_lowering.cpp
It may also perform some specific transformation based on the enum, such as the scheduling policy.

Overall, I suggest we do not replace the existing enums unless they can't meet our requirements for some reason.

Best regards

Anjia Wang

On Thu, Nov 12, 2020, at 9:38 AM, Yonghong Yan wrote:

Anjia,

Can you give a source file URL for the builder and the unparsing that
use those enum? I want to see how much they are using and the amount
of work we need to refactor them.

On Thu, Nov 12, 2020 at 9:31 AM Anjia Wang anjiawang@gmail.com wrote:

Hello Dr. Yan,

Those enums are required as a parameter to create the corresponding SgOmpClause node. The ROSE builder functions only recognize the enums defined in the file Suport.code but not ours.

Another reason is the unparsing module in ROSE is based on the enums defined in Support.code as well. If we use our own enum set, that module has to be refactored.

Best regards

Anjia Wang

On Wed, Nov 11, 2020, at 2:45 PM, Yonghong Yan wrote:

What is the reason of redefining those enum in
https://github.com/passlab/rexompiler/blob/master/src/ROSETTA/Grammar/Support.code#L47
and then convert those definition in ompAstConstruction.cpp from
https://github.com/passlab/rexompiler/blob/master/src/frontend/SageIII/ompAstConstruction.cpp#L698.

Why cannot we use those defined in
https://github.com/passlab/ompparser/blob/d4b3f880a7fed899a9e1261620eaedf8ca6a8245/src/OpenMPKinds.h
directly?

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

No branches or pull requests

1 participant