Home // ADVCOMP 2017, The Eleventh International Conference on Advanced Engineering Computing and Applications in Sciences // View article


Automated Translation of MATLAB Code to C++ with Performance and Traceability

Authors:
Geir Yngve Paulsen
Stuart Clark
Bjørn Nordmoen
Sergey Nenakhov
Aron Andersson
Xing Cai
Hans Petter Dahle

Keywords: Code translation; Seismology; Image processing; MATLAB; C++

Abstract:
In this paper, we discuss the implementation and performance of m2cpp: an automated translator from MATLAB code to its matching Armadillo counterpart in the C++ language. A non-invasive strategy has been adopted, meaning that the user of m2cpp does not insert annotations or additional code lines into the input serial MATLAB code. Instead, a combination of code analysis, automated preprocessing and a user-editable metainfo file ensures that m2cpp overcomes some specialties of the MATLAB language, such as implicit typing of variables and multiple return values from functions. Thread-based parallelisation, using either OpenMP or Intel's Threading Building Blocks (TBB) library, can also be carried out by m2cpp for designated for-loops. Such an automated and non-invasive strategy allows maintaining an independent MATLAB code base that is favoured by algorithm developers, while an updated translation into the easily readable C++ counterpart can be obtained at any time. Illustrating examples from seismic data processing are provided in this paper, with performance results obtained on multicore Sandy Bridge CPUs and Intel's Knights-Landing Xeon Phi processor.

Pages: 50 to 55

Copyright: Copyright (c) IARIA, 2017

Publication date: November 12, 2017

Published in: conference

ISSN: 2308-4499

ISBN: 978-1-61208-599-9

Location: Barcelona, Spain

Dates: from November 12, 2017 to November 16, 2017