COMPILER TECHNIQUES FOR MATLAB PROGRAMS ... - CiteSeerX
COMPILER TECHNIQUES FOR MATLAB PROGRAMS ... - CiteSeerX
COMPILER TECHNIQUES FOR MATLAB PROGRAMS ... - CiteSeerX
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
have been made to the source language to allow ecient C code to be produced, such as<br />
the exclusion of all primitives for synchronization and communication, except for message<br />
passing. Some sort of type inference system is alluded to by the authors in their papers, but<br />
it is not described.<br />
A simple approach for the compilation of <strong>MATLAB</strong> was taken by [Ker95] to translate<br />
<strong>MATLAB</strong> into C++. In this work, a matrix class was created to take careofalltype and<br />
shape inference decisions during run-time. This class is then utilized by the generated C++.<br />
So, eectively, the control structure is compiled, but all the mathematical operations are<br />
still interpreted within this matrix class.<br />
Recently, MathWorks released MCC, a <strong>MATLAB</strong> Compiler [Mat95] that translates MAT-<br />
LAB programs into C for stand-alone external applications, or into C MEX-les which are<br />
called within the <strong>MATLAB</strong> environment. MEX-les are <strong>MATLAB</strong>-callable C or Fortran dynamically<br />
linked subroutines that are built with a special interface module. From [Mat95],<br />
it appears that MCC performs only simple inference and relies upon user provided ags,<br />
pragmas, and assertions 1<br />
to optimize the generated C code. In Chapter 7 we compare the<br />
performance of the codes generated by MCCandby our compiler for a set of <strong>MATLAB</strong><br />
programs.<br />
1 Assertions are M-les functions that are installed by the compiler and used to specify the intrinsic type<br />
or rank of a variable.<br />
11