next up previous contents
Next: Argument Remapping Up: HPF and Procedures Previous: Aligning to Dummy Arguments

 

Mapping Function Results

Clearly, must be able to map array-valued FUNCTION results,

   MODULE Block_Dist_1D_Template_Onto_P
     !HPF$ PROCESSORS, DIMENSION(2)  :: P
     !HPF$ TEMPLATE, DIMENSION(4)    :: T
     !HPF$ DISTRIBUTE (BLOCK) ONTO P :: T
   END MODULE Block_Dist_1D_Template_Onto_p

   FUNCTION ArF(A,B)
    USE Block_Dist_1D_Template_Onto_P
    IMPLICIT NONE
     REAL, INTENT(IN) :: A(:), B(:)
     REAL, DIMENSION(SIZE(A)) :: ArF
     !HPF$ ALIGN A(:) WITH *T(:)
     !HPF$ ALIGN B(:) WITH *T(:)
     !HPF$ ALIGN ArF(:) WITH T(:)
       ...
   END FUNCTION ArF

Here the result of the function is aligned to one of the dummy arguments.

An explicit interface should always be given containing all mapping information relating to dummy arguments and the function result.


next up previous contents
Next: Argument Remapping Up: HPF and Procedures Previous: Aligning to Dummy Arguments

Adam Marshall ©University of Liverpool, 1996
Fri Dec 6 15:03:35 GMT 1996
Not for commercial use.