C
Code4u
I have an application that manipulates large arrays of image data of
various types, all the usual arithmetic operations on the data objects
are supported. With careful design and tricks similar to those in
UBLAS (http://www.boost.org/libs/numeric/ublas/doc/) I have been able
to avoid temporaries where appropriate and carefully optimize code
(C++) that evaluates expressions, for example
Image A, B, C, D, E
A=((B+C)/D)+E
In this expression A is evaluated directly by looping through the
elements of B,C,D,E.
This all works fine and dandy if the image expressions are known at
compile time, but when it comes to scripting at run-time the
opimizations are lost. The only technique that preserves efficiency is
to generate object code for the image expression at run-time. In other
words build a simple expression compiler into the application and have
it generate native assembler as needed.
Is there precedent for this type of approach? Comments, ideas and
pointers to existing implementations would be most welcome.
various types, all the usual arithmetic operations on the data objects
are supported. With careful design and tricks similar to those in
UBLAS (http://www.boost.org/libs/numeric/ublas/doc/) I have been able
to avoid temporaries where appropriate and carefully optimize code
(C++) that evaluates expressions, for example
Image A, B, C, D, E
A=((B+C)/D)+E
In this expression A is evaluated directly by looping through the
elements of B,C,D,E.
This all works fine and dandy if the image expressions are known at
compile time, but when it comes to scripting at run-time the
opimizations are lost. The only technique that preserves efficiency is
to generate object code for the image expression at run-time. In other
words build a simple expression compiler into the application and have
it generate native assembler as needed.
Is there precedent for this type of approach? Comments, ideas and
pointers to existing implementations would be most welcome.