(j3.2006) "Contiguous" doesn't quite do what I need

Van Snyder van.snyder
Fri Mar 23 16:01:23 EDT 2007

On Fri, 2007-03-23 at 13:35 -0500, Bill Long wrote:
> > The "contiguous" attribute does nothing for the case of arrays known to
> > have extents in some (probably leading) dimensions given by
> > initialization expressions. 
> Clearly.  You are asking for a different feature.  Our task at this
> point, I think, is supposed to be getting the features that were
> approved correctly incorporated into the standard.

Call it different if you like, but what I propose completely subsumes
contiguous.  It's different in the sense that \integral f(x) dx is
different from \integral x^2 dx.

If I have a contiguous multidimensional array for which I know the
extent of the leading dimension is 3, or of the two leading dimensions
is 2x2, and I do an operation on (1:3,:) or (1:2,2:2,:), any benefit the
processor might have gotten from the contiguous attribute at least
partly (mostly?) evaporates, because the processor doesn't know the
extent from the declaration.  It has to assume that the spacing along
the second (third) dimension comes from the (product of the) length(s)
of the earlier dimension(s).  This will lead me to clutter my code with
#ifdef's that result from experiments that determine whether it's better
for a particular processor to peel loops or exploit contiguity, since
none can do both.  What a dog's breakfast we're making.

IMMNSHO, "contiguous" is not "correct" so what I'm proposing is in line
with our present goals.

Van Snyder                    |  What fraction of Americans believe 
Van.Snyder at jpl.nasa.gov       |  Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or

More information about the J3 mailing list