ROSE
0.9.6a
|
Classes | |
class | SgVarRefExpVisitor |
class | OmpAttributeList |
class | OmpAttribute |
class | translationDriver |
A driver to traverse AST trees and invoke individual translators for OpenMP constructs, (not in use) Postorder is preferred. More... | |
Typedefs | |
typedef std::map< const SgVariableSymbol *, SgVariableSymbol * > | VariableSymbolMap_t |
Functions | |
void | processOpenMP (SgSourceFile *sageFilePtr) |
std::string | toString (omp_construct_enum omp_type) |
Output omp_construct_enum to a string: More... | |
bool | isFortranEndDirective (omp_construct_enum omp_type) |
Check if the construct is a Fortran END ... directive. More... | |
bool | isFortranBeginDirective (omp_construct_enum omp_type) |
Check if the construct is a Fortran directive which can (optionally) have a corresponding END directive. More... | |
bool | isDirective (omp_construct_enum omp_type) |
Check if an OpenMP construct is a directive. More... | |
bool | isDirectiveWithBody (omp_construct_enum omp_type) |
Check if an OpenMP directive has a structured body. More... | |
bool | isClause (omp_construct_enum omp_type) |
Check if an OpenMP construct is a clause. More... | |
bool | isReductionOperator (omp_construct_enum omp_type) |
Check if an OpenMP construct is a reduction operator. More... | |
ROSE_DLL_API OmpAttribute * | buildOmpAttribute (enum omp_construct_enum directive_type, SgNode *context_node, bool useDefined) |
Some utility functions to manipulate OmpAttribute. More... | |
ROSE_DLL_API void | addOmpAttribute (OmpAttribute *ompattribute, SgNode *node) |
Add OmpAttribute to a SgNode. More... | |
ROSE_DLL_API void | removeOmpAttribute (OmpAttribute *ompattribute, SgNode *node) |
Remove OmpAttribute from a SgNode. More... | |
ROSE_DLL_API bool | isEquivalentOmpAttribute (OmpAttribute *a1, OmpAttribute *a2) |
Check if two OmpAttributes are semantically equivalent to each other. More... | |
ROSE_DLL_API OmpAttributeList * | getOmpAttributeList (SgNode *node) |
Get OmpAttribute from a SgNode, return NULL if not found. More... | |
OmpAttribute * | getOmpAttribute (SgNode *node) |
Get the first OmpAttribute from a SgNode, return NULL if not found. More... | |
omp_construct_enum | getOmpConstructEnum (SgPragmaDeclaration *decl) |
Get omp enum from an OpenMP pragma attached with OmpAttribute. More... | |
omp_construct_enum | getBeginOmpConstructEnum (omp_construct_enum end_enum) |
Get the corresponding begin construct enum from an end construct enum. More... | |
omp_construct_enum | getEndOmpConstructEnum (omp_construct_enum begin_enum) |
Get the corresponding end construct enum from a begin construct enum. More... | |
ROSE_DLL_API void | generatePragmaFromOmpAttribute (SgNode *sg_node) |
Generate a pragma declaration from OmpAttribute attached to a statement. More... | |
ROSE_DLL_API std::string | generateDiffTextFromOmpAttribute (SgNode *sg_node) |
Generate diff text from OmpAttribute attached to a statement. More... | |
int | patchUpSharedVariables (SgFile *) |
makeDataSharingExplicit() can call some of existing functions for some work in OmpSupport namespace by Hongyi 07/16/2012 TODO: add a function within the OmpSupport namespace, the function should transform the AST, so all variables' data-sharing attributes are explicitied represented in the AST. More... | |
int | makeDataSharingExplicit (SgFile *) |
void | commandLineProcessing (std::vector< std::string > &argvList) |
void | lower_omp (SgSourceFile *) |
The top level interface to translate OpenMP directives. More... | |
void | insertRTLHeaders (SgSourceFile *) |
Insert #include "xxx.h", the interface of a runtime library to the compiler. More... | |
void | insertRTLinitAndCleanCode (SgSourceFile *) |
Insert runtime init and terminate routines to main() entry. More... | |
void | transOmpParallel (SgNode *node) |
Translate omp parallel. More... | |
void | transOmpTargetParallel (SgNode *node) |
Translate omp parallel under "omp target". More... | |
void | transOmpSections (SgNode *node) |
Translate omp sections. More... | |
void | transOmpTask (SgNode *node) |
Translate omp task. More... | |
void | transOmpLoop (SgNode *node) |
Translate omp for or omp do loops. More... | |
void | transOmpTargetLoop (SgNode *node) |
Translate omp for or omp do loops affected by the "omp target" directive, Liao 1/28/2013. More... | |
void | transOmpTarget (SgNode *node) |
Translate Fortran omp do. More... | |
void | transOmpTargetData (SgNode *node) |
Translate "omp target data". More... | |
void | transOmpBarrier (SgNode *node) |
Translate omp barrier. More... | |
void | transOmpFlush (SgNode *node) |
Translate omp flush. More... | |
void | transOmpTaskwait (SgNode *node) |
Translate omp taskwait. More... | |
void | transOmpThreadprivate (SgNode *node) |
Translate omp threadprivate. More... | |
void | transOmpOrdered (SgNode *node) |
Translate the ordered directive (not the ordered clause) More... | |
void | transOmpAtomic (SgNode *node) |
Translate omp atomic. More... | |
void | transOmpCritical (SgNode *node) |
Translate omp critical. More... | |
void | transOmpMaster (SgNode *node) |
Translate omp master. More... | |
void | transOmpSingle (SgNode *node) |
Translate omp single. More... | |
SgFunctionDeclaration * | generateOutlinedTask (SgNode *node, std::string &wrapper_name, std::set< SgVariableSymbol * > &syms) |
A helper function to generate implicit or explicit task for either omp parallel or omp task. More... | |
ROSE_DLL_API void | transOmpVariables (SgStatement *ompStmt, SgBasicBlock *bb1, SgExpression *orig_loop_upper=NULL, bool withinAcceleratorModel=false) |
Translate OpenMP variables associated with an OpenMP pragma, such as private, firstprivate, lastprivate, reduction, etc. bb1 is the translation generated code block in which the variable handling statements will be inserted. Original loop upper bound is needed for implementing lastprivate (check if it is the last iteration). withinAcceleratorModel means if we only translate private() variables, used to support accelerator model. More... | |
ROSE_DLL_API SgInitializedNamePtrList | collectAllClauseVariables (SgOmpClauseBodyStatement *clause_stmt) |
Collect all variables from OpenMP clauses associated with an omp statement: private, reduction, etc. More... | |
ROSE_DLL_API SgInitializedNamePtrList | collectClauseVariables (SgOmpClauseBodyStatement *clause_stmt, const VariantT &vt) |
Collect variables from a particular type of OpenMP clauses associated with an omp statement: private, reduction, etc. More... | |
ROSE_DLL_API SgInitializedNamePtrList | collectClauseVariables (SgOmpClauseBodyStatement *clause_stmt, const VariantVector &vvt) |
Collect variables from given types of OpenMP clauses associated with an omp statement: private, reduction, etc. More... | |
ROSE_DLL_API bool | isInClauseVariableList (SgInitializedName *var, SgOmpClauseBodyStatement *clause_stmt, const VariantT &vt) |
Check if a variable is in a variable list of a given clause type. More... | |
ROSE_DLL_API bool | isInClauseVariableList (SgInitializedName *var, SgOmpClauseBodyStatement *clause_stmt, const VariantVector &vvt) |
Check if a variable is in variable lists of given clause types. More... | |
ROSE_DLL_API int | replaceVariableReferences (SgNode *root, SgVariableSymbol *oldVar, SgVariableSymbol *newVar) |
Replace references to oldVar within root with references to newVar, return the number of references replaced. More... | |
ROSE_DLL_API int | replaceVariableReferences (SgNode *root, VariableSymbolMap_t varRemap) |
Replace variable references within root based on a map from old symbols to new symbols. More... | |
int | replaceVariablesWithPointerDereference (SgNode *root, std::set< SgVariableSymbol * > &vars) |
Replace all variable references in a set by pointers to the variable. More... | |
ROSE_DLL_API void | addClauseVariable (SgInitializedName *var, SgOmpClauseBodyStatement *clause_stmt, const VariantT &vt) |
Add a variable into a non-reduction clause of an OpenMP statement, create the clause transparently if it does not exist. More... | |
ROSE_DLL_API SgOmpVariablesClause * | buildOmpVariableClause (SgOmpClauseBodyStatement *clause_stmt, const VariantT &vt) |
Build a non-reduction variable clause for a given OpenMP directive. It directly returns the clause if the clause already exists. More... | |
ROSE_DLL_API bool | hasClause (SgOmpClauseBodyStatement *clause_stmt, const VariantT &vt) |
Check if an OpenMP statement has a clause of type vt. More... | |
ROSE_DLL_API Rose_STL_Container < SgOmpClause * > | getClause (SgOmpClauseBodyStatement *clause_stmt, const VariantT &vt) |
Get OpenMP clauses from an eligible OpenMP statement. More... | |
ROSE_DLL_API bool | useStaticSchedule (SgOmpClauseBodyStatement *omp_loop) |
Check if an omp for/do loop use static schedule or not, including: default schedule, or schedule(static[,chunk_size]) More... | |
ROSE_DLL_API SgOmpClause::omp_reduction_operator_enum | getReductionOperationType (SgInitializedName *init_name, SgOmpClauseBodyStatement *clause_stmt) |
Return a reduction variable's reduction operation type. More... | |
ROSE_DLL_API SgExpression * | createInitialValueExp (SgOmpClause::omp_reduction_operator_enum r_operator) |
Create an initial value according to reduction operator type. More... | |
ROSE_DLL_API std::string | generateGOMPLoopStartFuncName (bool isOrdered, SgOmpClause::omp_schedule_kind_enum s_kind) |
Generate GOMP loop schedule start function's name. More... | |
ROSE_DLL_API std::string | generateGOMPLoopNextFuncName (bool isOrdered, SgOmpClause::omp_schedule_kind_enum s_kind) |
Generate GOMP loop schedule next function's name. More... | |
ROSE_DLL_API std::string | toString (SgOmpClause::omp_schedule_kind_enum s_kind) |
Convert a schedule kind enum value to a small case string. More... | |
ROSE_DLL_API int | patchUpPrivateVariables (SgFile *) |
Patch up private variables for omp for. The reason is that loop indices should be private by default and this function will make this explicit. More... | |
ROSE_DLL_API int | patchUpFirstprivateVariables (SgFile *) |
Patch up firstprivate variables for omp task. The reason is that the specification 3.0 defines rules for implicitly determined data-sharing attributes and this function will make the firstprivate variable of omp task explicit. More... | |
std::set< SgInitializedName * > | collectThreadprivateVariables () |
Collect threadprivate variables within the current project, return a set to avoid duplicated elements. No input parameters are needed since it finds match from memory pools. More... | |
SgVariableDeclaration * | buildAndInsertDeclarationForOmp (const std::string &name, SgType *type, SgInitializer *varInit, SgBasicBlock *orig_scope) |
Special handling when trying to build and insert a variable declaration into a BB within Fortran OpenMP code. More... | |
SgBasicBlock * | getEnclosingRegionOrFuncDefinition (SgNode *) |
Find an enclosing parallel region or function definition's body. More... | |
Variables | |
std::list< OmpAttribute * > | omp_comment_list |
bool | enable_accelerator |
unsigned int | nCounter |
omp_rtl_enum | rtl_type |
typedef std::map<const SgVariableSymbol *, SgVariableSymbol *> OmpSupport::VariableSymbolMap_t |
Definition at line 41 of file omp_lowering.h.
Definition at line 26 of file OmpAttribute.h.
The type of target runtime libraries (not yet in use)
Enumerator | |
---|---|
e_gomp | |
e_omni | |
e_last_rtl |
Definition at line 32 of file omp_lowering.h.
void OmpSupport::processOpenMP | ( | SgSourceFile * | sageFilePtr) |
std::string OmpSupport::toString | ( | omp_construct_enum | omp_type) |
Output omp_construct_enum to a string:
Referenced by DominatorTreesAndDominanceFrontiers::TemplatedDominatorTree< CFGFilterFunction >::writeDot().
bool OmpSupport::isFortranEndDirective | ( | omp_construct_enum | omp_type) |
Check if the construct is a Fortran END ... directive.
bool OmpSupport::isFortranBeginDirective | ( | omp_construct_enum | omp_type) |
Check if the construct is a Fortran directive which can (optionally) have a corresponding END directive.
bool OmpSupport::isDirective | ( | omp_construct_enum | omp_type) |
Check if an OpenMP construct is a directive.
Referenced by OmpSupport::OmpAttribute::setOmpDirectiveType().
bool OmpSupport::isDirectiveWithBody | ( | omp_construct_enum | omp_type) |
Check if an OpenMP directive has a structured body.
bool OmpSupport::isClause | ( | omp_construct_enum | omp_type) |
Check if an OpenMP construct is a clause.
bool OmpSupport::isReductionOperator | ( | omp_construct_enum | omp_type) |
Check if an OpenMP construct is a reduction operator.
ROSE_DLL_API OmpAttribute* OmpSupport::buildOmpAttribute | ( | enum omp_construct_enum | directive_type, |
SgNode * | context_node, | ||
bool | useDefined | ||
) |
Some utility functions to manipulate OmpAttribute.
A builder for OmpAttribute, useDefined indicates if the directive is added by programmer or not (by autoParallelization)
ROSE_DLL_API void OmpSupport::addOmpAttribute | ( | OmpAttribute * | ompattribute, |
SgNode * | node | ||
) |
Add OmpAttribute to a SgNode.
ROSE_DLL_API void OmpSupport::removeOmpAttribute | ( | OmpAttribute * | ompattribute, |
SgNode * | node | ||
) |
Remove OmpAttribute from a SgNode.
ROSE_DLL_API bool OmpSupport::isEquivalentOmpAttribute | ( | OmpAttribute * | a1, |
OmpAttribute * | a2 | ||
) |
Check if two OmpAttributes are semantically equivalent to each other.
ROSE_DLL_API OmpAttributeList* OmpSupport::getOmpAttributeList | ( | SgNode * | node) |
Get OmpAttribute from a SgNode, return NULL if not found.
OmpAttribute* OmpSupport::getOmpAttribute | ( | SgNode * | node) |
Get the first OmpAttribute from a SgNode, return NULL if not found.
omp_construct_enum OmpSupport::getOmpConstructEnum | ( | SgPragmaDeclaration * | decl) |
Get omp enum from an OpenMP pragma attached with OmpAttribute.
omp_construct_enum OmpSupport::getBeginOmpConstructEnum | ( | omp_construct_enum | end_enum) |
Get the corresponding begin construct enum from an end construct enum.
omp_construct_enum OmpSupport::getEndOmpConstructEnum | ( | omp_construct_enum | begin_enum) |
Get the corresponding end construct enum from a begin construct enum.
ROSE_DLL_API void OmpSupport::generatePragmaFromOmpAttribute | ( | SgNode * | sg_node) |
Generate a pragma declaration from OmpAttribute attached to a statement.
ROSE_DLL_API std::string OmpSupport::generateDiffTextFromOmpAttribute | ( | SgNode * | sg_node) |
Generate diff text from OmpAttribute attached to a statement.
int OmpSupport::patchUpSharedVariables | ( | SgFile * | ) |
makeDataSharingExplicit() can call some of existing functions for some work in OmpSupport namespace by Hongyi 07/16/2012 TODO: add a function within the OmpSupport namespace, the function should transform the AST, so all variables' data-sharing attributes are explicitied represented in the AST.
ROSE has dedicated AST nodes for OpenMP directives and the associated clauses, such as private, shared, reduction.
int OmpSupport::makeDataSharingExplicit | ( | SgFile * | ) |
void OmpSupport::commandLineProcessing | ( | std::vector< std::string > & | argvList) |
void OmpSupport::lower_omp | ( | SgSourceFile * | ) |
The top level interface to translate OpenMP directives.
void OmpSupport::insertRTLHeaders | ( | SgSourceFile * | ) |
Insert #include "xxx.h", the interface of a runtime library to the compiler.
void OmpSupport::insertRTLinitAndCleanCode | ( | SgSourceFile * | ) |
Insert runtime init and terminate routines to main() entry.
void OmpSupport::transOmpParallel | ( | SgNode * | node) |
Translate omp parallel.
void OmpSupport::transOmpTargetParallel | ( | SgNode * | node) |
Translate omp parallel under "omp target".
void OmpSupport::transOmpSections | ( | SgNode * | node) |
Translate omp sections.
void OmpSupport::transOmpTask | ( | SgNode * | node) |
Translate omp task.
void OmpSupport::transOmpLoop | ( | SgNode * | node) |
Translate omp for or omp do loops.
void OmpSupport::transOmpTargetLoop | ( | SgNode * | node) |
Translate omp for or omp do loops affected by the "omp target" directive, Liao 1/28/2013.
void OmpSupport::transOmpTarget | ( | SgNode * | node) |
Translate Fortran omp do.
Translate "omp target"
void OmpSupport::transOmpTargetData | ( | SgNode * | node) |
Translate "omp target data".
void OmpSupport::transOmpBarrier | ( | SgNode * | node) |
Translate omp barrier.
void OmpSupport::transOmpFlush | ( | SgNode * | node) |
Translate omp flush.
void OmpSupport::transOmpTaskwait | ( | SgNode * | node) |
Translate omp taskwait.
void OmpSupport::transOmpThreadprivate | ( | SgNode * | node) |
Translate omp threadprivate.
void OmpSupport::transOmpOrdered | ( | SgNode * | node) |
Translate the ordered directive (not the ordered clause)
void OmpSupport::transOmpAtomic | ( | SgNode * | node) |
Translate omp atomic.
void OmpSupport::transOmpCritical | ( | SgNode * | node) |
Translate omp critical.
void OmpSupport::transOmpMaster | ( | SgNode * | node) |
Translate omp master.
void OmpSupport::transOmpSingle | ( | SgNode * | node) |
Translate omp single.
SgFunctionDeclaration* OmpSupport::generateOutlinedTask | ( | SgNode * | node, |
std::string & | wrapper_name, | ||
std::set< SgVariableSymbol * > & | syms | ||
) |
A helper function to generate implicit or explicit task for either omp parallel or omp task.
ROSE_DLL_API void OmpSupport::transOmpVariables | ( | SgStatement * | ompStmt, |
SgBasicBlock * | bb1, | ||
SgExpression * | orig_loop_upper = NULL , |
||
bool | withinAcceleratorModel = false |
||
) |
Translate OpenMP variables associated with an OpenMP pragma, such as private, firstprivate, lastprivate, reduction, etc. bb1 is the translation generated code block in which the variable handling statements will be inserted. Original loop upper bound is needed for implementing lastprivate (check if it is the last iteration). withinAcceleratorModel means if we only translate private() variables, used to support accelerator model.
ROSE_DLL_API SgInitializedNamePtrList OmpSupport::collectAllClauseVariables | ( | SgOmpClauseBodyStatement * | clause_stmt) |
Collect all variables from OpenMP clauses associated with an omp statement: private, reduction, etc.
ROSE_DLL_API SgInitializedNamePtrList OmpSupport::collectClauseVariables | ( | SgOmpClauseBodyStatement * | clause_stmt, |
const VariantT & | vt | ||
) |
Collect variables from a particular type of OpenMP clauses associated with an omp statement: private, reduction, etc.
ROSE_DLL_API SgInitializedNamePtrList OmpSupport::collectClauseVariables | ( | SgOmpClauseBodyStatement * | clause_stmt, |
const VariantVector & | vvt | ||
) |
Collect variables from given types of OpenMP clauses associated with an omp statement: private, reduction, etc.
ROSE_DLL_API bool OmpSupport::isInClauseVariableList | ( | SgInitializedName * | var, |
SgOmpClauseBodyStatement * | clause_stmt, | ||
const VariantT & | vt | ||
) |
Check if a variable is in a variable list of a given clause type.
ROSE_DLL_API bool OmpSupport::isInClauseVariableList | ( | SgInitializedName * | var, |
SgOmpClauseBodyStatement * | clause_stmt, | ||
const VariantVector & | vvt | ||
) |
Check if a variable is in variable lists of given clause types.
ROSE_DLL_API int OmpSupport::replaceVariableReferences | ( | SgNode * | root, |
SgVariableSymbol * | oldVar, | ||
SgVariableSymbol * | newVar | ||
) |
Replace references to oldVar within root with references to newVar, return the number of references replaced.
ROSE_DLL_API int OmpSupport::replaceVariableReferences | ( | SgNode * | root, |
VariableSymbolMap_t | varRemap | ||
) |
Replace variable references within root based on a map from old symbols to new symbols.
int OmpSupport::replaceVariablesWithPointerDereference | ( | SgNode * | root, |
std::set< SgVariableSymbol * > & | vars | ||
) |
Replace all variable references in a set by pointers to the variable.
ROSE_DLL_API void OmpSupport::addClauseVariable | ( | SgInitializedName * | var, |
SgOmpClauseBodyStatement * | clause_stmt, | ||
const VariantT & | vt | ||
) |
Add a variable into a non-reduction clause of an OpenMP statement, create the clause transparently if it does not exist.
ROSE_DLL_API SgOmpVariablesClause* OmpSupport::buildOmpVariableClause | ( | SgOmpClauseBodyStatement * | clause_stmt, |
const VariantT & | vt | ||
) |
Build a non-reduction variable clause for a given OpenMP directive. It directly returns the clause if the clause already exists.
ROSE_DLL_API bool OmpSupport::hasClause | ( | SgOmpClauseBodyStatement * | clause_stmt, |
const VariantT & | vt | ||
) |
Check if an OpenMP statement has a clause of type vt.
ROSE_DLL_API Rose_STL_Container<SgOmpClause*> OmpSupport::getClause | ( | SgOmpClauseBodyStatement * | clause_stmt, |
const VariantT & | vt | ||
) |
Get OpenMP clauses from an eligible OpenMP statement.
ROSE_DLL_API bool OmpSupport::useStaticSchedule | ( | SgOmpClauseBodyStatement * | omp_loop) |
Check if an omp for/do loop use static schedule or not, including: default schedule, or schedule(static[,chunk_size])
ROSE_DLL_API SgOmpClause::omp_reduction_operator_enum OmpSupport::getReductionOperationType | ( | SgInitializedName * | init_name, |
SgOmpClauseBodyStatement * | clause_stmt | ||
) |
Return a reduction variable's reduction operation type.
ROSE_DLL_API SgExpression* OmpSupport::createInitialValueExp | ( | SgOmpClause::omp_reduction_operator_enum | r_operator) |
Create an initial value according to reduction operator type.
ROSE_DLL_API std::string OmpSupport::generateGOMPLoopStartFuncName | ( | bool | isOrdered, |
SgOmpClause::omp_schedule_kind_enum | s_kind | ||
) |
Generate GOMP loop schedule start function's name.
ROSE_DLL_API std::string OmpSupport::generateGOMPLoopNextFuncName | ( | bool | isOrdered, |
SgOmpClause::omp_schedule_kind_enum | s_kind | ||
) |
Generate GOMP loop schedule next function's name.
ROSE_DLL_API std::string OmpSupport::toString | ( | SgOmpClause::omp_schedule_kind_enum | s_kind) |
Convert a schedule kind enum value to a small case string.
ROSE_DLL_API int OmpSupport::patchUpPrivateVariables | ( | SgFile * | ) |
Patch up private variables for omp for. The reason is that loop indices should be private by default and this function will make this explicit.
ROSE_DLL_API int OmpSupport::patchUpFirstprivateVariables | ( | SgFile * | ) |
Patch up firstprivate variables for omp task. The reason is that the specification 3.0 defines rules for implicitly determined data-sharing attributes and this function will make the firstprivate variable of omp task explicit.
std::set<SgInitializedName*> OmpSupport::collectThreadprivateVariables | ( | ) |
Collect threadprivate variables within the current project, return a set to avoid duplicated elements. No input parameters are needed since it finds match from memory pools.
SgVariableDeclaration* OmpSupport::buildAndInsertDeclarationForOmp | ( | const std::string & | name, |
SgType * | type, | ||
SgInitializer * | varInit, | ||
SgBasicBlock * | orig_scope | ||
) |
Special handling when trying to build and insert a variable declaration into a BB within Fortran OpenMP code.
SgBasicBlock* OmpSupport::getEnclosingRegionOrFuncDefinition | ( | SgNode * | ) |
Find an enclosing parallel region or function definition's body.
std::list<OmpAttribute* > OmpSupport::omp_comment_list |
bool OmpSupport::enable_accelerator |
unsigned int OmpSupport::nCounter |
omp_rtl_enum OmpSupport::rtl_type |