|
From: | David Bateman |
Subject: | Re: JIT - automated mexing |
Date: | Thu, 24 Jun 2010 22:11:31 +0200 |
User-agent: | Mozilla-Thunderbird 2.0.0.22 (X11/20090706) |
Fotios Kasolis wrote:
What is automatic mexing but a use of a piece of compiled code in a JIT.. I don't really see the distinction. The hard bits are still the same (variable type discover, loop optimisation, etc).. Lucky LLVM does a lot of this stuff alreadyOn Jun 24, 2010, at 9:46 PM, David Bateman wrote:Fotios Kasolis wrote:Is there someone that is planing to introduce (or already implementing) JIT in Octave? If not, i ll place that on my MOST_DESIRED list. Unfortunately i do not have the knowledge (yet) to do it but i ll start working on that whenever i find some time (any help: links, books, whatever ;D). An idea (which i do not know if implementable but sounds so) Instead of a traditional JIT what about automated mexing? Sth likemex_my_loops(myfunc)will replace all (replaceable) loops by mexed ones? Does this sound reasonable (if not why?)? At least it sounds relatively easier than JIT and more user oriented (it is always good to have a choice) /FotiosI think JIT is a lot harder than you think. There is no strict variable typing in Octave and so you need to discover what types are used before you can call the appropriate compiled functions. Also variable types can be polymorphic. Consider something like a = 1 for i = 0:.1:2 a += asin(i); endfor Yes I know its an artifical example, but consider what happens to the type of a when i=1.1.... There is a JIT in FreeMat but FreeMat essentially got rid of there logical and single precision types to simplify the detection of code where the JIT compiler might be applied. I'd suggest you look at the JIT code in FreeMat in any case for inspiration, at http://freemat.svn.sourceforge.net/viewvc/freemat/branches/ArraySimplification/libs/libMatC/ Regards DavidI think of JIT as hard as it is but no more than that! But what about the automated mex code solution? /Fotios
D. -- David Bateman address@hidden 35 rue Gambetta +33 1 46 04 02 18 (Home) 92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)
[Prev in Thread] | Current Thread | [Next in Thread] |