Thread View: comp.sys.super
1 messages
1 total messages
Started by Alan McKenney
Tue, 15 Sep 1992 16:20
Compiler directives to enforce scalar (non-vector) mode
Author: Alan McKenney
Date: Tue, 15 Sep 1992 16:20
Date: Tue, 15 Sep 1992 16:20
41 lines
2170 bytes
2170 bytes
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!"
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