Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/2774959.2774961acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Techniques for efficient MATLAB-to-C compilation

Published: 13 June 2015 Publication History

Abstract

MATLAB to C translation is foreseen to raise the overall abstrac-tion level when mapping computations to embedded systems (pos-sibly consisting of software and hardware components), and thus for increasing productivity and for providing an automated model-driven design-flow. This paper describes recent work developed in the context of MATISSE, a MATLAB to C compiler targeting embedded systems. We introduce several techniques to allow the efficient generation of C code, such as weak types, primitives and matrix views. We evaluate the compiler with a set of 9 publicly available benchmarks, targeting both embedded systems and a desktop system. We compare the execution time of the generated C code with the original code running on MATLAB, achieving a geometric mean speedup of 8.1x, and qualitatively compare our results with the performance of related approaches. The use of the new techniques allowed the compiler to achieve performance im-provements of 46% on average.

References

[1]
MATLAB – the Language of Technical Computing. The MathWorks, Inc., http://www.mathworks.com/.
[2]
MATLAB Coder: Generate C and C++ code from MATLAB code. The MathWorks, Inc, 2012.
[3]
J. Bispo, P. Pinto, R. Nobre, T. Carvalho, J. M. Cardoso, and P. C. Diniz, “The MATISSE MATLAB compiler,” in 11th IEEE International Conference on Industrial Informatics (INDIN), 2013, pp. 602–608.
[4]
G. Kiczales, “Aspect-oriented programming,” ACM Comput. Surv. CSUR, vol. 28, no. 4es, p. 154, Dec. 1996.
[5]
J. D. Gradecki and N. Lesiecki, Mastering AspectJ: aspect-oriented programming in Java. NY, USA: John Wiley & Sons, 2003.
[6]
J. M. Cardoso, T. Carvalho, J. G. Coutinho, W. Luk, R. Nobre, P. Diniz, and Z. Petrov, “LARA: an aspect-oriented programming language for embedded systems,” in Proceedings of the 11th annual international conference on Aspect-oriented Software Development, Potsdam, Germany, 2012, pp. 179–190.
[7]
J. M. P. Cardoso, P. Diniz, J. G. Coutinho, and Z. Petrov, Compilation and Synthesis for Embedded Reconfigurable Systems. Springer, 2013.
[8]
Symja - Java Computer Algebra Library.
[9]
L. S. Blackford, A. Petitet, R. Pozo, K. Remington, R. C. Whaley, J. Demmel, J. Dongarra, I. Duff, S. Hammarling, G. Henry, and others, “An updated set of basic linear algebra subprograms (BLAS),” ACM Trans. Math. Softw., vol. 28, no. 2, pp. 135–151, 2002.
[10]
MATISSE. http://specs.fe.up.pt/tools/matisse/.
[11]
A. Prasad, J. Anantpur, and R. Govindarajan, “Automatic compilation of MATLAB programs for synergistic execution on heterogeneous processors,” in ACM Sigplan Notices, 2011, vol. 46, pp. 152– 163.
[12]
Octave. http://www.gnu.org/software/octave/.
[13]
M. Chevalier-Boisvert, L. Hendren, and C. Verbrugge, “Optimizing MATLAB through just-in-time specialization,” in Compiler Construction, 2010, pp. 46–65.
[14]
G. Almasi and D. A. Padua, MaJIC: A MATLAB just-in-time compiler. Springer, 2001.
[15]
L. A. De Rose, “Compiler Techniques for Matlab Programs,” Citeseer, 1996.
[16]
P. G. Joisha and P. Banerjee, “Static array storage optimization in MATLAB,” in ACM SIGPLAN Notices, San Diego, CA, USA, 2003, vol. 38, pp. 258–268.
[17]
P. G. Joisha and P. Banerjee, “A translator system for the MATLAB language,” Softw. Pract. Exp., vol. 37, no. 5, pp. 535–578, 2007.
[18]
P. G. Joisha and P. Banerjee, “An algebraic array shape inference system for MATLAB®,” ACM Trans. Program. Lang. Syst. TOPLAS, vol. 28, no. 5, pp. 848–907, 2006.
[19]
A. Nayak, M. Haldar, A. Choudhary, and P. Banerjee, “Parallelization of Matlab applications for a multi-FPGA system,” in Field-Programmable Custom Computing Machines, 2001. FCCM’01. The 9th Annual IEEE Symposium on, Rohnert Park, CA, USA, 2001, pp. 1– 9.
[20]
P. Banerjee, D. Bagchi, M. Haldar, A. Nayak, V. Kim, and R. Uribe, “Automatic conversion of floating point MATLAB programs into fixed point FPGA based hardware design,” in Field-Programmable Custom Computing Machines, 2003. 11th Annual IEEE Symposium on, Napa, CA, USA, 2003, pp. 263–264.
[21]
A. Casey, J. Li, J. Doherty, M. Chevalier-Boisvert, T. Aslam, A. Dubrau, N. Lameed, A. Aslam, R. Garg, S. Radpour, and others, “McLab: an extensible compiler toolkit for MATLAB and related languages,” in Proceedings of the Third C* Conference on Computer Science and Software Engineering, 2010, pp. 114–117.
[22]
T. Aslam, J. Doherty, A. Dubrau, and L. Hendren, “AspectMatlab: An aspect-oriented scientific programming language,” in Proceedings of the 9th International Conference on Aspect-Oriented Software Development, NY, USA, 2010, pp. 181–192.
[23]
N. A. Lameed, “Dynamic Compiler Optimization Techniques for MATLAB,” McGill University, 2013.
[24]
X. Li, “Mc2For: A MATLAB to FORTRAN 95 Compiler,” McGill University, 2014.
[25]
V. Kumar and L. Hendren, “MiX10: Compiling MATLAB to X10 for high performance,” in Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications, 2014, pp. 617––636.
[26]
J. Doherty, L. Hendren, and S. Radpour, “Kind analysis for MATLAB,” in ACM SIGPLAN Notices, 2011, vol. 46, pp. 99–118.
[27]
A. W. Dubrau and L. J. Hendren, Taming Matlab, vol. 47. ACM, 2012.
[28]
C.-Y. Shei, A. Yoga, M. Ramesh, and A. Chauhan, “MATLAB Parallelization through Scalarization,” in 15th Workshop on Interaction between Compilers and Computer Architectures (INTERACT), 2011, pp. 44–53.
[29]
João Bispo, Luís Reis, and João M. P. Cardoso, “C and OpenCL Generation from MATLAB,” in 30th ACM Symposium on Applied Computing (SAC 2015), Salamanca, Spain, 2015.

Cited By

View all
  • (2020)Recommendations for evaluating the performance of background subtraction algorithms for surveillance systemsMultimedia Tools and Applications10.1007/s11042-020-09838-xOnline publication date: 29-Sep-2020
  • (2019)Two-Level Approach for No-Reference Consumer Video Quality AssessmentIEEE Transactions on Image Processing10.1109/TIP.2019.292305128:12(5923-5938)Online publication date: Dec-2019
  • (2017)A MATLAB Vectorizing Compiler Targeting Application-Specific Instruction Set ProcessorsACM Transactions on Design Automation of Electronic Systems10.1145/299618222:2(1-28)Online publication date: 4-Jan-2017
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ARRAY 2015: Proceedings of the 2nd ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming
June 2015
59 pages
ISBN:9781450335843
DOI:10.1145/2774959
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 13 June 2015

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. MATLAB
  2. embedded systems
  3. source-to-source compilers

Qualifiers

  • Research-article

Funding Sources

Conference

PLDI '15
Sponsor:

Acceptance Rates

Overall Acceptance Rate 17 of 25 submissions, 68%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)9
  • Downloads (Last 6 weeks)0
Reflects downloads up to 26 Sep 2024

Other Metrics

Citations

Cited By

View all
  • (2020)Recommendations for evaluating the performance of background subtraction algorithms for surveillance systemsMultimedia Tools and Applications10.1007/s11042-020-09838-xOnline publication date: 29-Sep-2020
  • (2019)Two-Level Approach for No-Reference Consumer Video Quality AssessmentIEEE Transactions on Image Processing10.1109/TIP.2019.292305128:12(5923-5938)Online publication date: Dec-2019
  • (2017)A MATLAB Vectorizing Compiler Targeting Application-Specific Instruction Set ProcessorsACM Transactions on Design Automation of Electronic Systems10.1145/299618222:2(1-28)Online publication date: 4-Jan-2017
  • (2017)A MATLAB subset to C compiler targeting embedded systemsSoftware—Practice & Experience10.1002/spe.240847:2(249-272)Online publication date: 1-Feb-2017

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media