comp.lang.ada
 help / color / mirror / Atom feed
* Basic question on Ada multi-dimensional arrays, are they true (contiguous) arrays? aliasing rules?
@ 2011-12-21  1:08 Nasser M. Abbasi
  2011-12-21 19:11 ` John B. Matthews
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Nasser M. Abbasi @ 2011-12-21  1:08 UTC (permalink / raw)



Sorry for such a basic question on Ada, it has been a while since
I used Ada (but it remains my most favorite computer language).

We know that Fortran stores multi-dimensional arrays in a contiguous
sequence of memory, and Fortran has strong aliasing rules which allows
the compiler to more generate more efficient code when it comes to
Matrices access and manipulation and such. This is one reason that
Fortran code is fast for number crunching.

How is the situation in Ada when it comes to this issue? I am almost
sure that Ada 2D/3D matrices are also contiguous in memory (as compared
to say Java for example).

If so, how is the issue with aliasing rules? I read that c99 has
now a keyword called 'restrict' which is supposed to tell the compiler
that some arrays do not overlap in memory and the compiler can
generate efficient code like Fortran.

So my question really is: Is Ada generated code now for 2D/3D matrices
operations as efficient and Fast as Fortran?  Are there switches for
Gnat that one can use to improve this aspect of the code generation?

Are there are benchmarks comparing Ada for Fortran in this specific area?

Sorry if my question might be too general and not specific, but
I am just only wondering on how Ada number crushing with matrices
compares to Fortran there days.

thanks,
--Nasser



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-12-23  7:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21  1:08 Basic question on Ada multi-dimensional arrays, are they true (contiguous) arrays? aliasing rules? Nasser M. Abbasi
2011-12-21 19:11 ` John B. Matthews
2011-12-22  2:49   ` Jeffrey Carter
2011-12-23  7:34     ` John B. Matthews
2011-12-21 21:11 ` Adrian-Ken Rueegsegger
2011-12-21 21:13 ` Adrian-Ken Rueegsegger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox