This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Is it a bug: data aligment of matrix returned by gemm
- From: Tim Prince <TimothyPrince at sbcglobal dot net>
- To: Maciej dot Zwierzycki at ifmpan dot poznan dot pl
- Cc: fortran at gcc dot gnu dot org
- Date: Thu, 25 Jun 2009 06:04:24 -0700
- Subject: Re: Is it a bug: data aligment of matrix returned by gemm
- References: <20090625123831.GD19665@ifmpan.poznan.pl>
- Reply-to: tprince at computer dot org
Maciej Zwierzycki wrote:
> function matmul_func(a,b)
> real(kind=8),intent(in) :: a(:,:), b(:,:)
> real(kind=8) :: matmul_func(size(a,1),size(b,2))
>
> call dgemm('N','N',size(a,1),size(b,2),size(a,2),1.0d0,a,size(a,1),&
> &b,size(b,1),0.0d0,matmul_func,size(a,1))
>
> end function
>
> program test
> integer, paramater :: range=2
> real(kind=8) :: a(rank,rank), b(rank,rank), c(2,rank,rank)
>
> interface
> function matmul_func....
> ....
> end function matmul_func
> end interface
>
The compiler can't diagnose your syntax error, where you declare a with
intent(in), although I suppose it could in principle if it could scan the
source of dgemm. It should diagnose a syntax error when you don't set
rank, and I can't see how you could get results without rank. I don't see
your complaint about how dgemm fills a; it seems, contrary to what you
show, that you may have declared a such that size(a,1) is 2, and the
result then is what you requested.
I don't see how any of the stuff you mention could be deemed "correct" if
you don't provide correct source code.