Public Member Functions | Public Attributes | Friends | List of all members
OmpSupport::OmpAttribute Class Reference


One attribute object stores all information within an OpenMP pragma (directive and clauses)

Definition at line 313 of file OmpAttribute.h.

#include <OmpAttribute.h>

Collaboration diagram for OmpSupport::OmpAttribute:
Collaboration graph

Public Member Functions

SgPragmaDeclarationgetPragmaDeclaration ()
 -----------—AST connection---------------— Get the associated SgPragmaDeclaration for C/C++, if any
PreprocessingInfogetPreprocessingInfo ()
 Get the associated PreprocessingInfo for Fortran, if any.
void setPreprocessingInfo (PreprocessingInfo *info)
SgNodegetNode ()
 Get the associated SgNode, can be SgPragmaDeclaration or others( for fortran nodes or during parallelization)
void setNode (SgNode *n)
void setOmpDirectiveType (omp_construct_enum omptype)
 ---------—directive type----—
omp_construct_enum getOmpDirectiveType ()
void addClause (omp_construct_enum clause_type)
 --------—clauses-------------— Add a clause into an OpenMP directive, the content of the clause is set by other interface, such as addVariable(), addExpression() , setReductionOperator() etc. More...
bool hasClause (omp_construct_enum clause_type)
 Check if a directive has a clause of the specified type.
std::vector< omp_construct_enum > getClauses ()
 Get all existing clauses.
SgVariableSymboladdVariable (omp_construct_enum targetConstruct, const std::string &varString, SgInitializedName *sgvar=NULL)
 -----—var list -----------— Add a variable into a variable list of an OpenMP construct ,return the symbol of the variable added, if possible
SgVariableSymboladdVariable (omp_construct_enum targetConstruct, SgExpression *varExp)
 Add a variable ref expression to a clause: this is useful for array reference expression. A single variable symbol is not sufficient.
bool hasVariableList (omp_construct_enum)
 Check if a variable list is associated with a construct.
std::vector< std::pair< std::string, SgNode * > > getVariableList (omp_construct_enum)
 Get the variable list associated with a construct.
std::vector< enum omp_construct_enum > get_clauses (const std::string &variable)
 Find the relevant clauses for a variable.
bool appendDistDataPolicy (SgVariableSymbol *array_symbol, omp_construct_enum dist_data_policy, SgExpression *size_exp=NULL)
 Insert dist_data policy for one dimension of an array into its policy vector (duplicate, block(n), cyclic(4)) (up to size 3)
std::vector< std::pair< omp_construct_enum, SgExpression * > > getDistDataPolicy (SgVariableSymbol *array_symbol)
 Obtain data distribution policy for an array. There are up to 3 pairs for 3-D.
void addExpression (omp_construct_enum targetConstruct, const std::string &expString, SgExpression *sgexp=NULL)
 -----—Expressions --------------------------— Add an expression to a clause
std::pair< std::string, SgExpression * > getExpression (omp_construct_enum targetConstruct)
 Get expression of a clause.
void setReductionOperator (omp_construct_enum operatorx)
 -----—values for some clauses -------—
std::vector< omp_construct_enum > getReductionOperators ()
 Get reduction clauses for each operations, reduction(op:kind)
bool hasReductionOperator (omp_construct_enum operatorx)
 Check if a reduction operation exists.
void setDependenceType (omp_construct_enum operatorx)
std::vector< omp_construct_enum > getDependenceTypes ()
 Get dependence clauses for each type, depend(type:varlist)
bool hasDependenceType (omp_construct_enum operatorx)
 Check if a depend type exists.
void setMapVariant (omp_construct_enum operatorx)
std::vector< omp_construct_enum > getMapVariants ()
 Get map clauses for each variant, map(variant:var_list)
bool hasMapVariant (omp_construct_enum operatorx)
 Check if a map variant exists.
bool isMapVariant (omp_construct_enum omp_type)
 Check if the input parameter is a map variant enum type.
void setDefaultValue (omp_construct_enum valuex)
omp_construct_enum getDefaultValue ()
void setProcBindPolicy (omp_construct_enum valuex)
omp_construct_enum getProcBindPolicy ()
void setAtomicAtomicity (omp_construct_enum valuex)
omp_construct_enum getAtomicAtomicity ()
omp_construct_enum getScheduleKind ()
void setScheduleKind (omp_construct_enum kindx)
bool isInConstruct (const std::string &variable, enum omp_construct_enum)
 Check if a variable is inside a variable list of a clause/directive.
void setCriticalName (const std::string &name)
 Set name for named critical section.
std::string getCriticalName ()
bool isNamedCritical ()
void print ()
 Pretty print the OmpAttribute.
bool get_isUserDefined ()
std::string toOpenMPString ()
 Convert OmpAttribute to a legal OpenMP pragma string,.

Public Attributes

std::map< SgSymbol *, std::vector< std::pair< SgExpression *, SgExpression * > > > array_dimensions
 Dimension information for array variables, used by map clause, such as map (tofrom:array[0:n][0:m])
std::map< SgSymbol *, std::vector< std::pair< omp_construct_enum, SgExpression * > > > dist_data_policies


OmpAttributebuildOmpAttribute (omp_construct_enum directive_type, SgNode *node, bool userDefined)
 Some utility functions to manipulate OmpAttribute. More...

Member Function Documentation

void OmpSupport::OmpAttribute::addClause ( omp_construct_enum  clause_type)

--------—clauses-------------— Add a clause into an OpenMP directive, the content of the clause is set by other interface, such as addVariable(), addExpression() , setReductionOperator() etc.

Friends And Related Function Documentation

OmpAttribute* buildOmpAttribute ( omp_construct_enum  directive_type,
SgNode node,
bool  userDefined 

Some utility functions to manipulate OmpAttribute.

A builder for OmpAttribute, useDefined indicates if the directive is added by programmer or not (by autoParallelization)

The documentation for this class was generated from the following file: