J3/05-186 To: J3 From: Bill Long/HPC Subject: Update of Repository item J3-043 Date: 13-may-2005 This paper incorporates modifications to the CONTIGUOUS attribute proposal that were decided at meeting 172/Delft WG5. ------------------------------------------------------------------ Number: J3-043 Title: contiguous pointers Submitted By: J3 Status: For Consideration References: J3/04-132, J3/05-149r2 Basic Functionality: Provide a method to indicate that the target of a pointer or an actual argument is contiguous. Rationale: Many unnecessary operations happen because compilers cannot determine that a data item occupies contiguous memory. For example, contiguous memory is needed to pass an array to a procedure with an implicit interface. Certain optimizations are possible if the compiler knows that the memory stride for the left-most subscript is 1, or if a whole array occupies a contiguous memory block. Thus, the mere use of pointers often results in substantially suboptimal code. If the compiler knew that the pointer was constrained to point to contiguous memory, very much better code could be generated. Similar optimization problems exist for assumed-shape dummy arguments. Estimated Impact: The effort was estimated as 5 on the John Reid scale at M167. Detailed Specification: Provide a declaration attribute, CONTIGUOUS, that specifies that the pointer being declared will only be associated with a target occupying a storage sequence or that the elements of an assumed-shape dummy argument occupy a storage sequence. The processor may need to make a contiguous copy of an actual argument associated with a dummy argument with the contiguous attribute. For example, real, pointer, contiguous :: sptr(:) real, contiguous, dimension(:,:) :: d A corresponding CONTIGUOUS :: statement is also provided. An intrinsic function, IS_CONTIGUOUS(A), is also provided. The argument is an array or array section. The result is .true. if the argument occupies a storage sequence, and .false. otherwise. History: Paper 04-132 meeting 167 Submitted 05-149r2 171 Accepted as complete 05-186 172 Feature modified by WG5 vote