Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!andrew.cmu.edu!bk19+ From: bk19+@andrew.cmu.edu (Bradley D. Keister) Newsgroups: comp.lang.c++ Subject: inline and vectorization Message-ID: Date: 6 Dec 89 19:28:38 GMT Organization: Physics, Carnegie Mellon, Pittsburgh, PA Lines: 24 I'd like to see some discussion on the use of inline in C++ for vectorizing code to run on a machine like a Cray Y-MP. Typical programs that I write involve multidimensional integrals whose integrands in turn involve manipulating small vectors and matrices, with a complex or real number as a result. I have now made classes for most of these vector and matrix types. The advantage of declaring them inline is that calls to their functions in the innermost loop can be eliminated (a single call in the innermost loop will defeat vectorization where it counts most: executing pieces of the integration loops in parallel). However, most of the C++ literature and postings I've seen strongly discourage the use of inline except under special circumstances, and indeed this is borne out when the backend C compiler gets overloaded with nested inline statements. It appears that making vectorizable code in C++ does not have an advantage, at least in terms of using inline. Is there a way out of this? Should I go back to using macros? Brad Keister Physics Department Carnegie Mellon U keister@iguana.psc.edu (412) 268-2772