public class OpenMp extends DirectiveGenerator
Constructor and Description |
---|
OpenMp()
Constructs a new object with the given target.
|
Modifier and Type | Method and Description |
---|---|
CompilerDirective |
getDirectiveLanguage()
Get the target of the current generator.
|
java.lang.String[] |
getEndDataRegion()
Get the end pragma to define the end of an directive data region.
|
java.lang.String[] |
getEndLoopDirective()
Get the formatted directive to end the parallelization of a loop.
|
java.lang.String[] |
getEndParallelDirective()
Get the end pragma to define a parallel accelerated region.
|
java.lang.String |
getParallelKeyword()
Get the parallel keyword for a given directive language.
|
java.lang.String |
getPrefix()
Get the prefix for the current directive language.
|
java.lang.String |
getPrivateClause(java.util.List<java.lang.String> vars)
Return construction of the clause for a list of private variables.
|
java.lang.String |
getPrivateClause(java.lang.String var)
Return construction of the clause for a private variable.
|
java.lang.String[] |
getRoutineDirective(boolean seq)
Return the formatted directive to be inserted in a subroutine/function
definition.
|
java.lang.String |
getSequentialClause()
Get the corresponding clause to have a sequential execution of an
accelerated region.
|
java.lang.String[] |
getSingleDirective(java.lang.String clause)
Get formatted pragma defined by the directive directive prefix and the
given clauses.
|
java.lang.String[] |
getStartDataRegion(java.util.List<java.lang.String> clauses)
Get the start pragma to define the start of an directive data region.
|
java.lang.String[] |
getStartLoopDirective(int value,
boolean seq,
boolean naked,
java.lang.String clauses)
Get the formatted directive to start the parallelization of a loop.
|
java.lang.String[] |
getStartParallelDirective(java.lang.String clauses)
Get the start pragma to define a parallel accelerated region.
|
boolean |
isCompileGuard(java.lang.String rawDirective)
Check whether the raw directive is a CLAW compile guard that must be
removed.
|
getCreateClause, getPresentClause, getSkippedStatementsInEpilogue, getSkippedStatementsInPreamble, getUnsupportedStatements, getUpdateClause
public java.lang.String getPrefix()
DirectiveGenerator
getPrefix
in class DirectiveGenerator
public java.lang.String[] getStartParallelDirective(java.lang.String clauses)
DirectiveGenerator
getStartParallelDirective
in class DirectiveGenerator
clauses
- Additional clauses append at the start directive.public java.lang.String[] getEndParallelDirective()
DirectiveGenerator
getEndParallelDirective
in class DirectiveGenerator
public java.lang.String[] getSingleDirective(java.lang.String clause)
DirectiveGenerator
getSingleDirective
in class DirectiveGenerator
clause
- Clauses to append to the directive directive prefixpublic java.lang.String getParallelKeyword()
DirectiveGenerator
getParallelKeyword
in class DirectiveGenerator
public java.lang.String getPrivateClause(java.lang.String var)
DirectiveGenerator
getPrivateClause
in class DirectiveGenerator
var
- Variable name that will be inserted in the generated clause.public java.lang.String getPrivateClause(java.util.List<java.lang.String> vars)
DirectiveGenerator
getPrivateClause
in class DirectiveGenerator
vars
- List of variables name that will be inserted in the generated
clause.public java.lang.String[] getRoutineDirective(boolean seq)
DirectiveGenerator
getRoutineDirective
in class DirectiveGenerator
seq
- Apply sequential mode to the routine directivepublic boolean isCompileGuard(java.lang.String rawDirective)
DirectiveGenerator
isCompileGuard
in class DirectiveGenerator
rawDirective
- The raw directive without any preprocessing.public CompilerDirective getDirectiveLanguage()
DirectiveGenerator
getDirectiveLanguage
in class DirectiveGenerator
public java.lang.String[] getStartDataRegion(java.util.List<java.lang.String> clauses)
DirectiveGenerator
getStartDataRegion
in class DirectiveGenerator
clauses
- Additional clauses append at the start directive.public java.lang.String[] getEndDataRegion()
DirectiveGenerator
getEndDataRegion
in class DirectiveGenerator
public java.lang.String getSequentialClause()
DirectiveGenerator
getSequentialClause
in class DirectiveGenerator
public java.lang.String[] getStartLoopDirective(int value, boolean seq, boolean naked, java.lang.String clauses)
DirectiveGenerator
getStartLoopDirective
in class DirectiveGenerator
value
- Collapse value. if greater than 0, a collapse clause will be
added to the construct.seq
- If true, loop should be executed in a sequential mode.naked
- If true, simple directive is generated without special
clauses.clauses
- Additional clauses append at the start directive.public java.lang.String[] getEndLoopDirective()
DirectiveGenerator
getEndLoopDirective
in class DirectiveGenerator