Is it a bug: data aligment of matrix returned by gemm
Tim Prince
TimothyPrince@sbcglobal.net
Thu Jun 25 13:04:00 GMT 2009
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.
More information about the Fortran
mailing list