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

Description

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

Definition at line 320 of file OmpAttribute.h.

#include <OmpAttribute.h>

Collaboration diagram for OmpSupport::OmpAttribute:
Collaboration graph
[legend]

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.
 
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
 

Member Function Documentation

◆ getPreprocessingInfo()

PreprocessingInfo * OmpSupport::OmpAttribute::getPreprocessingInfo ( )
inline

Get the associated PreprocessingInfo for Fortran, if any

Definition at line 328 of file OmpAttribute.h.

◆ setPreprocessingInfo()

void OmpSupport::OmpAttribute::setPreprocessingInfo ( PreprocessingInfo info)
inline

Definition at line 329 of file OmpAttribute.h.

◆ getNode()

SgNode * OmpSupport::OmpAttribute::getNode ( )
inline

Get the associated SgNode, can be SgPragmaDeclaration or others( for fortran nodes or during parallelization)

Definition at line 332 of file OmpAttribute.h.

◆ setNode()

void OmpSupport::OmpAttribute::setNode ( SgNode n)
inline

Definition at line 333 of file OmpAttribute.h.

◆ setOmpDirectiveType()

void OmpSupport::OmpAttribute::setOmpDirectiveType ( omp_construct_enum  omptype)
inline

---------—directive type----—

Definition at line 335 of file OmpAttribute.h.

References OmpSupport::isDirective().

◆ getOmpDirectiveType()

omp_construct_enum OmpSupport::OmpAttribute::getOmpDirectiveType ( )
inline

Definition at line 336 of file OmpAttribute.h.

◆ getCriticalName()

std::string OmpSupport::OmpAttribute::getCriticalName ( )
inline

Definition at line 447 of file OmpAttribute.h.

◆ isNamedCritical()

bool OmpSupport::OmpAttribute::isNamedCritical ( )
inline

Definition at line 448 of file OmpAttribute.h.

◆ get_isUserDefined()

bool OmpSupport::OmpAttribute::get_isUserDefined ( )
inline

Definition at line 454 of file OmpAttribute.h.

Member Data Documentation

◆ array_dimensions

std::map<SgSymbol*, std::vector < std::pair <SgExpression*, SgExpression*> > > OmpSupport::OmpAttribute::array_dimensions

Dimension information for array variables, used by map clause, such as map (tofrom:array[0:n][0:m])

Definition at line 362 of file OmpAttribute.h.

◆ dist_data_policies

std::map<SgSymbol* , std::vector < std::pair<omp_construct_enum, SgExpression*> > > OmpSupport::OmpAttribute::dist_data_policies

Definition at line 369 of file OmpAttribute.h.


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