public class ClawPragma extends AnalyzedPragma
_pragma
Constructor and Description |
---|
ClawPragma()
Constructs an empty ClawPragma section.
|
ClawPragma(Xnode pragma)
Constructs an empty ClawPragma object with an attached pragma.
|
Modifier and Type | Method and Description |
---|---|
void |
addDimension(DimensionDefinition dimension)
Add a new dimension extracted from the directive.
|
static ClawPragma |
analyze(Xnode pragma)
Analyze a raw string input and match it with the CLAW language definition.
|
static ClawPragma |
createLoopFusionLanguage(ClawPragma master)
Create an instance of ClawPragma that correspond to a loop-fusion
directive.
|
static ClawPragma |
createLoopInterchangeLanguage(ClawPragma master,
Xnode pragma)
Create an instance of ClawPragma that correspond to a loop-interchange
directive.
|
java.lang.String |
getAcceleratorClauses()
Get the directive clauses extracted from the directive clause.
|
java.lang.String |
getArrayName()
Get the array name extracted from the call directive.
|
int |
getCollapseValue()
Get the collapse clause extracted value.
|
ClawConstraint |
getConstraintClauseValue()
Get the constraint clause value.
|
DataMovement |
getCopyClauseValue()
Get the copy clause value.
|
java.util.List<java.lang.String> |
getDataClauseValues()
Get the identifier values extracted from the data clause.
|
java.util.List<DimensionDefinition> |
getDimensionsForData(java.lang.String identifier) |
java.util.List<DimensionDefinition> |
getDimensionValues()
Get the dimensions extracted information.
|
java.util.List<DimensionDefinition> |
getDimensionValuesReversed()
Get the dimensions extracted information in reverse order.
|
ClawDirective |
getDirective()
Get the current directive of the language section.
|
java.lang.String |
getFctName()
Get the fct name extracted from the call directive.
|
java.util.List<java.lang.String> |
getFctParams()
Get the list of parameters extracted from the call directive.
|
java.lang.String |
getGroupValue()
Get the group name defined in the group clause.
|
java.util.List<java.lang.String> |
getHoistInductionVars()
Get the list of induction variables used in the hoist directive.
|
java.util.List<java.lang.String> |
getIndexes()
Get the loop index list
|
java.util.List<java.lang.String> |
getInductionValues()
Get the name value extracted from the induction clause.
|
java.util.List<ClawMapping> |
getMappings()
Get the list of extracted ClawMapping objects.
|
java.util.List<java.lang.Integer> |
getOffsets()
Get the list of offsets.
|
java.util.List<java.util.List<java.lang.String>> |
getOverClauseValues()
Get the dimensions values extracted from the over clause.
|
java.util.List<java.util.List<java.lang.String>> |
getOverDataClauseValues()
Get the data values extracted from the data over clause.
|
ClawRange |
getRange()
Get the range extracted value.
|
java.util.List<ReshapeInfo> |
getReshapeClauseValues()
Get the reshape extracted information.
|
java.util.List<java.lang.String> |
getScalarClauseValues()
Get the data clause values extracted from the scalar clause.
|
java.util.List<Target> |
getTargetClauseValues()
Get the target clause value.
|
DataMovement |
getUpdateClauseValue()
Get the update clause value.
|
boolean |
hasAcceleratorClause()
Check whether the current directive has the directive clause enabled.
|
boolean |
hasCollapseClause()
Check whether the collapse clause is used.
|
boolean |
hasConstraintClause()
Check whether the constraint clause is used.
|
boolean |
hasCopyClause()
Check whether the copy clause is used.
|
boolean |
hasCreateClause()
Check whether the create clause is used.
|
boolean |
hasDataClause()
Check whether the current directive has the induction clause enabled.
|
boolean |
hasDimensionClause()
Check whether the dimension clause is used.
|
boolean |
hasForwardClause()
Check whether the forward clause is used.
|
boolean |
hasFusionClause()
Check whether the current directive has the fusion clause enabled.
|
boolean |
hasGroupClause()
Check whether a group clause was specified.
|
boolean |
hasIndexes()
Check whether the interchange directive has indexes values.
|
boolean |
hasInductionClause()
Check whether the current directive has the induction clause enabled.
|
boolean |
hasInitClause()
Check whether the init clause is used.
|
boolean |
hasInterchangeClause()
Check whether the interchange clause is used.
|
boolean |
hasOverClause()
Check whether the current directive has the over clause enabled.
|
boolean |
hasOverDataClause()
Check whether the current directive has the data over clause enabled.
|
boolean |
hasParallelClause()
Check whether the current directive has the parallel clause enabled.
|
boolean |
hasPrivateClause()
Check whether the private clause is used.
|
boolean |
hasReshapeClause()
Check whether the reshape clause is used.
|
boolean |
hasScalarClause()
Check whether the current directly has the scalar clause enabled.
|
boolean |
hasTargetClause()
Check whether the target clause is used.
|
boolean |
hasUpdateClause()
Check whether the update clause is used.
|
boolean |
isApplicableToCurrentTarget()
Check if the current transformation target (defined by user) match with the
target defined in the clause.
|
void |
processDataOverClauses(java.util.List<java.lang.String> data,
java.util.List<java.lang.String> over) |
void |
setAcceleratorClauses(java.lang.String clauses)
Enable the directive clause for the current directive and set the
extracted clauses.
|
void |
setArrayName(java.lang.String value)
Set the array name value.
|
void |
setCollapseClause(java.lang.String n)
Set the collapse number and boolean flag.
|
void |
setConstraintClauseValue(ClawConstraint value)
Set the constraint clause value and the update clause usage flag to true.
|
void |
setCopyClauseValue(DataMovement value)
Set the copy clause value and the copy clause usage flag to true.
|
void |
setCreateClause()
Enable the create clause.
|
void |
setDataClause(java.util.List<java.lang.String> data)
Enable the data clause for the current directive and set the extracted
identifiers value.
|
void |
setDirective(ClawDirective directive)
Define the current directive of the language section.
|
void |
setFctName(java.lang.String value)
Set the function name value.
|
void |
setFctParams(java.util.List<java.lang.String> data)
Set the list of parameters for the fct call of the "call" directive
|
void |
setForwardClause()
Set the forward clause.
|
void |
setFusionClause()
Enable the fusion clause for the current directive.
|
void |
setGroupClause(java.lang.String groupName)
Set the group name and hasGroupClause to true
|
void |
setHoistInductionVars(java.util.List<java.lang.String> vars)
Set the list of induction variables used in the loop-hoist directive.
|
void |
setIndexes(java.util.List<java.lang.String> indexes)
Set the list of interchange indexes.
|
void |
setInductionClause(java.util.List<java.lang.String> names)
Enable the induction clause for the current directive and set the extracted
name value.
|
void |
setInitClause()
Set the init clause flag.
|
void |
setInterchangeClause()
Set the interchange clause as used.
|
void |
setMappings(java.util.List<ClawMapping> mappings)
Set the ClawMapping list
|
void |
setOffsets(java.util.List<java.lang.Integer> offsets)
Set the offsets list extracted from the kcache directive.
|
void |
setOverClause(java.util.List<java.lang.String> data)
Enable the over clause for the current directive and set the extracted
dimensions value.
|
void |
setOverDataClause(java.util.List<java.lang.String> data)
Enable the data over clause for the current directive.
|
void |
setParallelClause()
Enable the parallel clause for the current directive.
|
void |
setPrivateClause()
Set the private clause flag.
|
void |
setRange(ClawRange range)
Set the range value.
|
void |
setReshapeClauseValues(java.util.List<ReshapeInfo> infos)
Set the reshape clause extracted information.
|
void |
setScalarClause(java.util.List<java.lang.String> data)
Enable scalar clause for the current directive and stores the data.
|
void |
setTargetClauseValue(java.util.List<Target> values)
Set the target clause value and the update clause usage flag to true.
|
void |
setUpdateClauseValue(DataMovement value)
Set the update clause value and the update clause usage flag to true.
|
static boolean |
startsWithClaw(Xnode pragma)
Check if the pragma statement starts with the claw keyword.
|
getPragma, isEndPragma, setEndPragma, setPragma
public ClawPragma()
public ClawPragma(Xnode pragma)
pragma
- The pragma that is attached to the ClawPragma object.public static boolean startsWithClaw(Xnode pragma)
pragma
- The raw pragma element object to check.public static ClawPragma analyze(Xnode pragma) throws IllegalDirectiveException
pragma
- A raw pragma element object to be analyzed against the
CLAW language.IllegalDirectiveException
- If directive does not follow the CLAW
language specification.public static ClawPragma createLoopFusionLanguage(ClawPragma master)
master
- Base object which initiate the creation of this instance.public static ClawPragma createLoopInterchangeLanguage(ClawPragma master, Xnode pragma)
master
- Base object which initiate the creation of this instance.pragma
- Pragma statement located just before the first do stmt.public boolean hasGroupClause()
public void setGroupClause(java.lang.String groupName)
groupName
- The group name defined in the group clause.public java.lang.String getGroupValue()
public boolean hasCollapseClause()
public void setCollapseClause(java.lang.String n)
n
- Number of loop to be collapsed. Will be converted to integer.public int getCollapseValue()
public java.util.List<java.lang.String> getIndexes()
public void setIndexes(java.util.List<java.lang.String> indexes)
indexes
- List of indexes as string.public boolean hasIndexes()
public ClawRange getRange()
public void setRange(ClawRange range)
range
- A ClawRange object.public java.util.List<ClawMapping> getMappings()
public void setMappings(java.util.List<ClawMapping> mappings)
mappings
- A list of ClawMapping objects.public void setFusionClause()
public boolean hasFusionClause()
public void setParallelClause()
public boolean hasParallelClause()
public boolean hasAcceleratorClause()
public java.lang.String getAcceleratorClauses()
public void setAcceleratorClauses(java.lang.String clauses)
clauses
- Accelerator clauses extracted from the directive clause.public java.util.List<java.lang.Integer> getOffsets()
public void setOffsets(java.util.List<java.lang.Integer> offsets)
offsets
- A list of offsets.public boolean hasInterchangeClause()
public void setInterchangeClause()
public java.util.List<java.lang.String> getHoistInductionVars()
public void setHoistInductionVars(java.util.List<java.lang.String> vars)
vars
- List of induction variable.public ClawDirective getDirective()
public void setDirective(ClawDirective directive)
directive
- A value of the ClawDirective enumeration.public void setInductionClause(java.util.List<java.lang.String> names)
names
- List of induction name extracted from the clause.public boolean hasInductionClause()
public java.util.List<java.lang.String> getInductionValues()
public void setDataClause(java.util.List<java.lang.String> data)
data
- List of identifiers extracted from the clause.public boolean hasDataClause()
public java.util.List<java.lang.String> getDataClauseValues()
public void setOverClause(java.util.List<java.lang.String> data)
data
- List of dimension extracted from the clause.public void processDataOverClauses(java.util.List<java.lang.String> data, java.util.List<java.lang.String> over)
public java.util.List<DimensionDefinition> getDimensionsForData(java.lang.String identifier)
public boolean hasOverClause()
public java.util.List<java.util.List<java.lang.String>> getOverClauseValues()
public void setOverDataClause(java.util.List<java.lang.String> data)
data
- List of array identifiers extracted from the clause.public boolean hasOverDataClause()
public java.util.List<java.util.List<java.lang.String>> getOverDataClauseValues()
public void setScalarClause(java.util.List<java.lang.String> data)
data
- List of identifier declared in the scalar clause.public boolean hasScalarClause()
public java.util.List<java.lang.String> getScalarClauseValues()
public boolean hasInitClause()
public void setInitClause()
public boolean hasPrivateClause()
public void setPrivateClause()
public java.util.List<java.lang.String> getFctParams()
public void setFctParams(java.util.List<java.lang.String> data)
data
- List of identifiers extracted from the clause.public java.lang.String getArrayName()
public void setArrayName(java.lang.String value)
value
- String value for the array name.public java.lang.String getFctName()
public void setFctName(java.lang.String value)
value
- String value for the function name.public java.util.List<ReshapeInfo> getReshapeClauseValues()
public void setReshapeClauseValues(java.util.List<ReshapeInfo> infos)
infos
- List of ReshapeInfo objects containing the extracted
information from the reshape clause.public boolean hasReshapeClause()
public void setForwardClause()
public boolean hasForwardClause()
public boolean hasDimensionClause()
public void addDimension(DimensionDefinition dimension)
dimension
- DimensionDefinition object constructed from the value
extracted in the clause.public boolean hasCopyClause()
public DataMovement getCopyClauseValue()
public void setCopyClauseValue(DataMovement value)
value
- New copy clause value.public boolean hasUpdateClause()
public DataMovement getUpdateClauseValue()
public void setUpdateClauseValue(DataMovement value)
value
- New update clause value.public boolean hasTargetClause()
public java.util.List<Target> getTargetClauseValues()
public void setTargetClauseValue(java.util.List<Target> values)
values
- New target clause values.public boolean hasConstraintClause()
public ClawConstraint getConstraintClauseValue()
public void setConstraintClauseValue(ClawConstraint value)
value
- New constraint clause value.public java.util.List<DimensionDefinition> getDimensionValues()
public java.util.List<DimensionDefinition> getDimensionValuesReversed()
public boolean isApplicableToCurrentTarget()
public boolean hasCreateClause()
public void setCreateClause()