Thread View: comp.sys.super
2 messages
2 total messages
Started by Alan McKenney
Tue, 29 Sep 1992 14:04
Re: Compiler directives to enforce scalar (non-vector) mode
Author: Alan McKenney
Date: Tue, 29 Sep 1992 14:04
Date: Tue, 29 Sep 1992 14:04
77 lines
3640 bytes
3640 bytes
A while back I posted:
> I am currently writing (well, updating) a code which is
> supposed to be (a) portable and (b) have one loop which will be
> vectorized (on vector machines) and another, very similar, which will
> not be. (The scalar version is for the case when the loop will
> only iterate a very few times.)
>
> My first attempt had the first loop be written in a typical
> vectorizable form, the second I put enough scalars into to make
> it scalar on one machine I used. I later found that other
> compilers were smarter, and *both* loops vectorized. I suspect
> that as compiler technology improves, any code which foils the
> vectorizer now will either (a) soon be vectorizable or (b)
> be so obfuscated that it will be slower than vector mode
> with vector length one anyway.
>
> So, I am now going to try just putting in compiler directives,
> enough so that most any vector machine should recognize one. CONVEX
> machines require "C$DIR SCALAR" just before the DO, while CRI machines
> want "CDIR$ NOVECTOR" in the same place, so my scalar loop currently
> starts out:
>
> C$DIR SCALAR
> CDIR$ NOVECTOR
> DO ....
>
>
> Any other compiler directives that I should add to the list?
The summary:
CRI: CDIR$ NEXTSCALAR (I was informed that "NOVECTOR"
turns off vectorization until
the next "VECTOR" directive.)
Convex: C$DIR SCALAR
KAI: CDIR$ NEXT SCALAR (note possible problem w/ CRI)
PSR: CVD$L NOVECTOR
DEC: CDEC$ NOVECTOR
Alliant: CVD$ NOVECTOR
NEC SX-3: *VDIR NOVECTOR (unclear whether "*" could be "C")
Fujitsu *VOCL LOOP,SCALAR (unclear whether "*" could be "C")
IBM Cxxx PREFER SCALAR (where "xxx" is specified to the
compiler by a command argument.)
Livermore loops brackets scalar loops w/ "CDIR$ NOVECTOR" (start) and
"CDIR$ VECTOR" (end)
One poster said that many compilers accept the CRI directives, even if
they don't document it. Anybody have more concrete info?
Most of the mail showed the directives in lower case, I assumed that
they are case-insensitive and have reported them in upper. Some
showed directives beginning with * instead of C, I didn't know
whether compilers consider them interchangeable, so I didn't
report them all as C.
One problem that seems to have come up: there are often
separate directives to specify scalar mode for the next loop
only and for the rest of the program unit/file, e.g.,
for Cray, "NOVECTOR" turns off vectorization until a "VECTOR"
directive, while "NEXTSCALAR" turns off vectorization only
for the next loop. Thus, my table should really have 4 columns:
Machine. Vectorization off Vectorization on Next loop only scalar:
------- ----------------- ---------------- ---------------------
Convex ??? ??? C$DIR SCALAR
CRI CDIR$ NOVECTOR CDIR$ VECTOR CDIR$ NEXTSCALAR
...
--
Alan McKenney E-mail: mckenney@cims.nyu.edu (INTERNET)
Courant Institute,NYU,USA ...!cmcl2!cims.nyu.edu!mckenney (UUCP)
Re: Compiler directives to enforce scalar (non-vector) mode
Author: Eugene N. Miya
Date: Tue, 29 Sep 1992 18:13
Date: Tue, 29 Sep 1992 18:13
21 lines
1337 bytes
1337 bytes
In article <9209291404.AA12207@GAUSS.CIMS.NYU.EDU> mckenney@CIMS.NYU.EDU
(Alan McKenney) writes:
>One poster said that many compilers accept the CRI directives, even if
>they don't document it. Anybody have more concrete info?
Check the Convex fc man page for the -cfc (Cray Fortran compatibility option).
This must take some of the options.
Lamont writes:
>>(And what does he actually *do* at NASA Ames????)
Right now (next window over) I'm thrashing an UltraNet. ;^)
--eugene miya, NASA Ames Research Center, eugene@orville.nas.nasa.gov
No Jack Kennedy
Acting Associate Editor, Software and Publication Reviews
Scientific Programming
{uunet,mailrus,other gateways}!ames!eugene
Seeking Books to buy: Bongard, Pattern Recognition
Imhof, Cartographic Relief Presentation
Books on or by Benjamin Whorf
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads