Re: GNAT compiler switches and optimization
- From: "Dr. Adrian Wrigley" <amtw@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 23 Oct 2006 17:57:01 GMT
On Mon, 23 Oct 2006 19:11:51 +0200, Warner BRUNS wrote:
Georg Bauhaus wrote:
On Mon, 2006-10-23 at 14:40 +0200, Warner BRUNS wrote:It will help with all Ada/ Fortran Compiler combinations,
A problem with Ada is that the memory layout of multidimensional arrays
is not specified in the standard. If you want to have the same memory
layout for all Ada compilers, you have to specify that a multimensional
array should follow the convention of a foreign language, eg. Fortran.
Will a memory layout cast in source really help with e.g. all
Ada X Fortran combinations of compilers and libraries?
It might disallow "knowledgeable" compilers to choose a layout
that suits the current setup, I'd think, and require touching
the sources.
-- Georg
but the really strange thing is that the memory layout is not
definitely known from the Ada source alone, if it is not specified
as being the layout as required by a different language, eg. Fortran.
If one wants to code a cache aware algorithm for eg. multiplying
matrices, one cannot do this in Ada without enforcing the memory
layout of the matrices via PRAGMA CONVENTION.
A agree that it seems like an omission from the Ada standard.
This specification should be available using a representation
clause. Telling the compiler to allocate it like Fortran
would is the wrong way, logically.
Of course, if it really mattered, you could use an array of arrays
(like in C), or an array of array accesses. With appropriate
use of pragma representation you have a very high degree of flexibility.
Compare this to almost any other language, and you find Ada leads
the field by a mile. What if you wanted an alternative layout
in Fortran? Or C++?
Sometimes I'd like to see some intermingling of row/column ordering,
so a page in memory holds a square sub-array of a 2-D array.
The approach I'll take (if I get around to it!) is to use a
2-D array of acceses, allocated (by a pool allocator) with the
desired pattern. Moral of the story: One Size does not Fit All...
--
Adrian
.
- References:
- GNAT compiler switches and optimization
- From: tkrauss
- Re: GNAT compiler switches and optimization
- From: Jeffrey R. Carter
- Re: GNAT compiler switches and optimization
- From: Jeffrey Creem
- Re: GNAT compiler switches and optimization
- From: Gautier
- Re: GNAT compiler switches and optimization
- From: Jeffrey Creem
- Re: GNAT compiler switches and optimization
- From: Pascal Obry
- Re: GNAT compiler switches and optimization
- From: Jeffrey Creem
- Re: GNAT compiler switches and optimization
- From: Jeffrey Creem
- Re: GNAT compiler switches and optimization
- From: Jeffrey Creem
- Re: GNAT compiler switches and optimization
- From: Damien Carbonne
- Re: GNAT compiler switches and optimization
- From: Warner BRUNS
- Re: GNAT compiler switches and optimization
- From: Georg Bauhaus
- Re: GNAT compiler switches and optimization
- From: Warner BRUNS
- GNAT compiler switches and optimization
- Prev by Date: Re: AW: GNAT compiler switches and optimization
- Next by Date: Re: AW: GNAT compiler switches and optimization
- Previous by thread: Re: GNAT compiler switches and optimization
- Next by thread: Re: GNAT compiler switches and optimization
- Index(es):
Relevant Pages
|