Limiting the scope of consistent regions
The @autonomous annotation specifies that an operator that starts an autonomous region and its reachability graph does not participate in the drain and reset of a region. It is not part of a consistent region. Regarding the reachability graph, the @autonomous annotation works the same way as the @consistent annotation. The @autonomous annotation is in effect for all the operators in the reachability graph of the annotated operator.
The following figures show how the @autonomous annotation interacts with the @consistent annotation.
One composite operator with one autonomous region
The following figure shows an example of the @autonomous annotation that is applied to a composite operator. In the same way as the @consistent annotation, the compiler automatically identifies op11 and op12 as the start operators of the annotated composite operator, which effectively stops the draining and resetting that would otherwise flow through that composite. Because the two consistent regions do not connect, the example subgraph yields two independent consistent regions.
One primitive operator with one autonomous region
The following figure shows an example where the @autonomous annotation is applied to a primitive operator to end the consistent region that is defined by the upstream composite operator. The reachability graph of the operator that starts the autonomous region (op11) stops when the reachability graph of the autonomous operator reaches an operator that is in the reachability graph of a consistent region (op15).
One primitive operator with one autonomous region that precedes a consistent region
The following figure shows an example where the reachability graph of a primitive operator that is annotated with @autonomous stops when it reaches an operator that is annotated with @consistent. This example yields two different consistent regions.
One composite operator with one autonomous region and an inner consistent region
The following figure shows an example where the @autonomous annotation is applied to a composite operator. The reachability graph starts at op11 and stops at op13 because op13 is annotated with @consistent and is a primitive operator within the composite operator.