Array operations -- not actually so difficult

Don Clugston dac at nospam.com.au
Sat Dec 16 00:54:47 PST 2006


Knud Sørensen wrote:
> I expect for the array operation in 2.0 is something like vectorization.
> see http://www.all-technology.com/eigenpolls/dwishlist/index.php?it=10
> 
> Which allows you (in one line) to make multidimensional calculations on
> an arbitrary number of multidimensional arrays, 
> but it still allows you to read exactly which indexed is used 
> and the exact calculation performed. 
> 
> The syntax don't generate temporary arrays 
> and allow the compiler to freely reorder nested loops.

This doesn't generate temporary arrays either. The point is, that with 
this bit of syntax sugar, we could use expression templates to do 
virtually all of this stuff. Vectorisation is notoriously difficult for 
compilers to do well without help; this is an easy way of assisting the 
compiler.

> Also the compiler will be free to support for SSE? 
> and GPUs in the future without your having to rewriting the
> vectorization code.
>  
> I don't expect to see this in 1.0 I am just pointing out 
> that the array operation you suggest here seems fare from 
> my expectations for 2.0.



> 
> Knud



More information about the Digitalmars-d mailing list