[ HPF Home | Versions | Compilers | Projects | Publications | Applications | Benchmarks | Events | Contact ] |
If, on invocation of a procedure P: (a) a dummy argument has the TARGET attribute, and (b) the corresponding actual argument has the TARGET attribute and is not an array section with a vector subscript (and therefore is an object A or a section of an array A), then the program is HPF-conforming only if:
If the dummy argument does not have the TARGET or POINTER attribute, any pointers associated with the actual argument do not become associated with the corresponding dummy argument on invocation of the procedure.(End of rationale.)If the dummy argument has the TARGET attribute and the corresponding actual argument has the TARGET attribute but is not an array section with a vector subscript:
- Any pointers associated with the actual argument become associated with the corresponding dummy argument on invocation of the procedure.
- When execution of the procedure completes, any pointers associated with the dummy argument remain associated with the actual argument.
If the dummy argument has the TARGET attribute and the corresponding actual argument does not have the TARGET attribute or is an array section with a vector subscript, any pointers associated with the dummy argument become undefined when execution of the procedure completes.
Here is an example that illustrates the restrictions of this section:
INTEGER, TARGET, DIMENSION (10) :: ACT INTEGER, POINTER, DIMENSON (:) :: POINTS_TO_ACT, POINTS_TO_DUM !HPF$ DISTRIBUTE ACT(BLOCK) POINTS_TO_ACT => ACT CALL F(ACT) POINTS_TO_DUM(1) = 1 ! ILLEGAL CONTAINS SUBROUTINE F(DUM) INTEGER, TARGET, DIMENSION(10) :: DUM !HPF$ DISTRIBUTE DUM(CYCLIC) POINTS_TO_DUM => DUM POINTS_TO_ACT(1) = 1 ! ILLEGAL END SUBROUTINE END
The assignment to POINTS_TO_DUM(1) is illegal because it violates item 2b; the assignment to POINTS_TO_ACT(1) is illegal because it violates item 2a.
©2000-2006 Rice University | [ Contact Us | HiPerSoft | Computer Science ] |