This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: F95 vectorization support
- From: Ted Byers <r dot ted dot byers at rogers dot com>
- To: ASIF LAKHANY <asif dot lakhany at gmail dot com>, fortran at gcc dot gnu dot org
- Date: Tue, 17 Jun 2008 16:59:38 -0400 (EDT)
- Subject: Re: F95 vectorization support
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=rogers.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=TnLgHwdg3A8TAm5LdUrs8y/APjXY8h33Nj+uRsGOLzkUBTCPo0USBvXI3dkm9CbhgGZx182XBGeuC4ZjUCNeu3SmeY1vrLYXzyCL5e9qu9D0EvuJ22Q1odfDExAWfCZdeRtEbb6PnR/PIt5wJwGESMyqzgUL7asfRqa5R6bva1s=;
--- ASIF LAKHANY <asif.lakhany@gmail.com> wrote:
> Recently I have been involved in mixed language
> programming on Solaris
> sparc/x86 using Sun CC. I clearly see amazing
> performance improvements
> when off-loading mathematically
> intensive code to F95. I am new to F95. I generally
> develop in C++.
> From what I see it looks that gfortran may not
> provide anything beyond
> what g++ would
> provide. Is the compiler sensitive to vectorization
> supported by F95?
> It is very essential for me to know this as I rather
> not offload
> calculations if there is
> no gain whatsoever.
>
First, I have never actually seen a Sun workstation,
so I don't know those tools or that platform.
What I CAN tell you, having programmed fortran since
1980 and C++ since 1992, is that at present, I can
make my best C++ code outperform my best fortran code.
I don't generally see a big difference until I start
employing template metaprogramming "magic". ;-) The
truth is that even then, I can get my fortran code to
run at the same speed as my C++ code if I MANUALLY do
what my template metaprogramming does, but I find the
template metaprogramming SOOOOOOOO much easier, and
less dependant on the skill of the programmer to
recognise opportunities for optimization and his
skills at taking advantage of them.
What I find the biggest advantage of mixed language
programming is where there is a large, well
established library of math routines written in
fortran that would be useful to me. In that case, I
won't reinvent the wheel. I'll just use it, perhaps
with more more pain than writing a C++ wrapper for the
fortran library I want to use.
Whether or not continuing with mixed language
programming will be a benefit to you depends entirely
on what code exists already, what resources you want
to use, and the skill sets of those you're working
with. You DO say you see amazing performance
improvements when off-loading mathematically intensive
code to F95, so I'd suggest continuing on with the
effort.
And if you find a way to do something like template
metaprogramming in fortran, let me know. :-)
HTH
Ted