home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.super:944 comp.lang.fortran:3569
- Path: sparky!uunet!spool.mu.edu!caen!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!ukma!psuvax1!rutgers!cmcl2!CIMS.NYU.EDU!mckenney
- From: mckenney@CIMS.NYU.EDU (Alan McKenney)
- Newsgroups: comp.sys.super,comp.lang.fortran
- Subject: Compiler directives to enforce scalar (non-vector) mode
- Summary: What are the compiler directives for scalar mode on
- various vector machines?
- Message-ID: <9209151620.AA13202@GAUSS.CIMS.NYU.EDU>
- Date: 15 Sep 92 16:20:34 GMT
- Sender: daemon@cmcl2.nyu.edu (Mr Background)
- Followup-To: comp.sys.super
- Organization: Courant Institute, NYU, NY, NY, USA
- Lines: 41
-
-
- 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?
-
- ********************************************
- * Please send me E-mail, and I will try to *
- * summarize for the net. *
- ********************************************
-
- (Boy, I wish someone would come up with a standard for such
- compiler directives.)
-
-
-
- Alan McKenney
- E-mail: mckenney@cims.nyu.edu <-- "accept no substitutes!"
-