This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Matrix Flattening and Transposing optimizations
- From: Razya Ladelsky <RAZYA at il dot ibm dot com>
- To: "Richard Guenther" <richard dot guenther at gmail dot com>
- Cc: dberlin at dberlin dot org, dnovillo at redhat dot com, gcc-patches at gcc dot gnu dot org, "Richard Henderson" <rth at redhat dot com>
- Date: Wed, 28 Mar 2007 13:15:21 +0200
- Subject: Re: [PATCH] Matrix Flattening and Transposing optimizations
"Richard Guenther" <richard.guenther@gmail.com> wrote on 27/03/2007
23:25:16:
> On 3/27/07, Richard Henderson <rth@redhat.com> wrote:
> > On Sun, Mar 25, 2007 at 01:21:32PM +0200, Razya Ladelsky wrote:
> > > a = (int **) malloc(dim1 * sizeof(int *));
> > > for (i=0; i<dim1; i++)
> > > a[i] = (int *) malloc (dim2 * sizeof(int));
> >
> > Do people really do this...
> >
> > > a = (int *) malloc (dim1 * dim2 *sizeof(int));
> >
> > ... as opposed to this?
>
> Of course they do. Like for 456.hmmer or a CFD code I know of, even
> for three dimensions(!) (no, not tramp3d ;))
>
> Richard.
Actually I've looked at tramp3d...
In tramp3d centering_table_m is a global 3 dimensional
matrix, allocated this way:
centering_table_m = new Centering<Dim>**[CellType+1];
for (int i = 0; i <= CellType; ++i) {
centering_table_m[i] = new Centering<Dim>*[2];
for (int j = 0; j < 2; ++j)
centering_table_m[i][j] = new Centering<Dim>[1<<Dim];
So I guess this could also be a candidate for matrix
optimizations.
Razya