This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Is it a bug: data aligment of matrix returned by gemm


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]