(j3.2006) What do typical processors do?
Toon Moene
toon
Wed Jul 19 13:53:04 EDT 2017
On 07/19/2017 01:00 AM, Van Snyder wrote:
> Should I expect a processor to optimize
>
> C = matmul ( A, conjg(transpose(B)) )
>
> without making two or three temps, or should I write a matmul that has
> options to do that, or use *GEMM?
I think this answers the question for gfortran 6.4:
toon at moene:~/src$ cat complextranspose.f90
complex a(20,10), b(20,10), c(20,20)
a = 1.5
b = 9.2
c = matmul(a, conjg(transpose(b)))
print*, c
end
toon at moene:~/src$ gfortran -S -Warray-temporaries complextranspose.f90
complextranspose.f90:4:14:
c = matmul(a, conjg(transpose(b)))
1
Warning: Creating array temporary at (1) [-Warray-temporaries]
toon at moene:~/src$
toon at moene:~/src$ gfortran -S -O3 -Warray-temporaries complextranspose.f90
toon at moene:~/src$
The *real* question is, though:
Why doesn't transpose(<something complex>) *mean* conjg(transpose(<it>))
? I can't imagine someone wanting anything else ...
[ I wasn't a member yet when this was argued about for Fortran 90 ]
Kind regards,
--
Toon Moene - e-mail: toon at moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
At home: http://moene.org/~toon/; weather: http://moene.org/~hirlam/
Progress of GNU Fortran: http://gcc.gnu.org/wiki/GFortran#news
More information about the J3
mailing list