[Radiance-dev] vectorization data types

Greg Ward gregoryjward at gmail.com
Mon Feb 27 17:18:02 CET 2006


Well, it's a bit out of date, but there's the old document that  
describes the source tree.  Probably not really what you're looking  
for, but it's all I know about:

	http://radsite.lbl.gov/radiance/refer/srctree.pdf

While I agree there may be some vectorization possibilities offered  
by the many color and vector operations in the code, I don't know  
that they would really pay off as the set-up time (overhead) would  
probably eliminate any savings you got from a single assignment or  
dot product.  Vectorization helps much more when you have longer  
vectors and arrays, and everything is 3-vectors in Radiance.

If you want to test the idea if short vectors can actually speed up  
the code, work on the known bottlenecks first, like the ray traversal  
code in src/rt/raytrace.c.  In particular, the raymove() routine.   
Try vectorizing:

	pos[0] += r->rdir[0]*t;
	pos[1] += r->rdir[1]*t;
	pos[2] += r->rdir[2]*t;

I suspect you will see negligible gains, because (1) the overhead  
will kill you and (2) the conditional code above this dominates on  
modern pipelined processors.

-G

> From: "Lars Grobe" <grobe at gmx.net>
> Date: February 27, 2006 5:40:24 AM PST
>
> I hoped at least for some transformations (instances, oconv), maybe  
> even
> color calculation. In fact, every code snippet where the same  
> function is
> applied to x,y,z (like fvect[0]=...; fvect[1]=...; fvect[2]=...;)  
> should
> win, as such calculations could apply to the whole vector at once,  
> maybe
> some color calculations as well.
>
> In fact, the growth of a ray tree from a cluster of rays is  
> something I
> simply did not consider, as I am really not a programmer, so the  
> idea of
> tracing more than one ray at once (which was so pretty thinking about
> ambient calculation) was nonsense.
>
> But I will stop now and have a look at the code before I continue  
> to write a
> word ;-) Is there a nice schematic overview over the raytracing  
> routines on
> the net? I have my "RwR" left in Germany because it was a bit heavy  
> to take
> it in the plane ;-)))
>
> CU Lars.



More information about the Radiance-dev mailing list