- All Superinterfaces:
ASTNode,BlockItemNode,OmpExecutableNode,OmpNode,OmpWorksharingNode,StatementNode
This interface represents the OpenMP loop construct.
The syntax of the loop construct is specified in Section 2.7.1, OpenMP 4.0.0, as follows:
The syntax of the loop construct is specified in Section 2.7.1, OpenMP 4.0.0, as follows:
#pragma omp for [clause[[,] clause] ... ] new-line for-loopswhere clause is one of the following:
private(list) firstprivate(list) lastprivate(list) reduction(reduction-identifier: list) schedule(kind[, chunk_size]) collapse(n) ordered nowait
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe schedule kind of an OpenMP for pragma.Nested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.ASTNode
ASTNode.NodeKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.statement.BlockItemNode
BlockItemNode.BlockItemKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.omp.OmpExecutableNode
OmpExecutableNode.OmpExecutableKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.omp.OmpNode
OmpNode.OmpNodeKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.omp.OmpWorksharingNode
OmpWorksharingNode.OmpWorksharingNodeKindNested classes/interfaces inherited from interface dev.civl.abc.ast.node.IF.statement.StatementNode
StatementNode.StatementKind -
Method Summary
Modifier and TypeMethodDescriptionReturns the assertions to be checked before the entry of this loop construct.Returns the chunk size.intcollapse()Returns the number of loops associated with this loop construct.Returns the loop invariant.booleanReturns true ifforderedclause is present.intordered()schedule()Returns the schedule kind of the loop construct.voidsetAssertions(SequenceNode<FunctionCallNode> assertions) Updates the assertions to be checked before the entry of this loop construct.voidsetChunsize(ExpressionNode chunkSize) Updates the chunk size of this loop construct.voidsetCollapse(int value) Updates the number of loops associated with this loop construct.voidsetInvariant(FunctionCallNode invariant) Updates the loop invariant of this loop construct.voidsetOrdered(int value) Updates the ordered flag of this loop construct.voidsetSchedule(OmpForNode.OmpScheduleKind ompScheduleKind) Updates the schedule kind of this loop construct.Methods inherited from interface dev.civl.abc.ast.node.IF.ASTNode
addAllTransformAnnotations, addTransformAnnotation, child, childIndex, children, diff, equiv, getAttribute, getOwner, getScope, getSource, id, keepOnly, nextDFS, nodeKind, numChildren, parent, prettyPrint, prettyRepresentation, prettyRepresentation, print, remove, removeChild, removeTransformAnnotation, setAttribute, setChild, setId, setOwner, setScope, toString, transformAnnotationsMethods inherited from interface dev.civl.abc.ast.node.IF.statement.BlockItemNode
blockItemKindMethods inherited from interface dev.civl.abc.ast.node.IF.omp.OmpExecutableNode
copyinList, copyprivateList, firstprivateList, isComplete, lastprivateList, nowait, ompExecutableKind, privateList, reductionList, setCopyinList, setCopyprivateList, setFirstprivateList, setLastprivateList, setNowait, setPrivateList, setReductionList, setSharedList, setStatementNode, sharedList, statementNodeMethods inherited from interface dev.civl.abc.ast.node.IF.omp.OmpNode
ompNodeKindMethods inherited from interface dev.civl.abc.ast.node.IF.omp.OmpWorksharingNode
ompWorkshareNodeKindMethods inherited from interface dev.civl.abc.ast.node.IF.statement.StatementNode
copy, statementKind
-
Method Details
-
schedule
OmpForNode.OmpScheduleKind schedule()Returns the schedule kind of the loop construct. The default schedule is implementation defined, in our case we chooseSTATIC.- Returns:
- The schedule kind of the loop construct.
-
setSchedule
Updates the schedule kind of this loop construct.- Parameters:
ompScheduleKind- The schedule kind to be used to update this loop construct.
-
collapse
int collapse()Returns the number of loops associated with this loop construct. 1 by default if there is no explicit collapse clause.- Returns:
- The number of loops associated with this loop construct.
-
setCollapse
void setCollapse(int value) Updates the number of loops associated with this loop construct.- Parameters:
value- The number to be used to update this loop construct.
-
isOrdered
boolean isOrdered()Returns true ifforderedclause is present.- Returns:
- true iff
orderedclause is present.
-
ordered
int ordered()- Returns:
- the number of loops associated with
orderedclause.
-
setOrdered
void setOrdered(int value) Updates the ordered flag of this loop construct.- Parameters:
value- The value to be used to update this loop construct.
-
chunkSize
ExpressionNode chunkSize()Returns the chunk size. NULL if there is no schedule clause.- Returns:
- the chunk size, NULL if there is no schedule clause.
-
setChunsize
Updates the chunk size of this loop construct.- Parameters:
chunkSize- The expression node representing the new chunk size.
-
assertions
SequenceNode<FunctionCallNode> assertions()Returns the assertions to be checked before the entry of this loop construct.- Returns:
- the assertions to be checked before the entry of this loop construct.
-
setAssertions
Updates the assertions to be checked before the entry of this loop construct.- Parameters:
assertions- The assertions to be used to update this loop construct.
-
invariant
FunctionCallNode invariant()Returns the loop invariant.- Returns:
- the loop invariant.
-
setInvariant
Updates the loop invariant of this loop construct.- Parameters:
invariant- The assertion to be used as the new invariant.
-