Automatic Vectorization for MATLAB
نویسندگان
چکیده
Dynamic array-based languages such as MATLAB provide a wide range of built-in operations which can be efficiently applied to all elements of an array. Historically, MATLAB and Octave programmers have been advised to manually transform loops to equivalent “vectorized” computations in order to maximize performance. In this paper we present the techniques and tools to perform automatic vectorization, including handling for loops with calls to user-defined functions. We evaluate the technique on 9 benchmarks using two interpreters and two JIT-based platforms and show that automatic vectorization is extremely effective for the interpreters on most benchmarks, and moderately effective on some benchmarks in the JIT context.
منابع مشابه
Vectorized Matlab codes for linear two-dimensional elasticity
A vectorized Matlab implementation for the P1 finite element is provided for the twodimensional linear elasticity with mixed boundary conditions. Vectorization means that there is no loop over triangles. Numerical experiments show that our implementation is more efficient than the standard implementation with a loop over all triangles.
متن کاملVectorized Adaptive Quadrature in Matlab
Adaptive quadrature codes process a collection of subintervals one at a time. We show how to process them all simultaneously and so exploit vectorization and the use of fast built-in functions and array operations that are so important to efficient computation in Matlab. Using algebraic transformations we have made it just as easy for users to solve problems on infinite intervals and with moder...
متن کاملVectorized Solution of ODEs in Matlab
Vectorization is very important to the efficiency of computation in the popular problem-solving environment Matlab. It is shown that a class of Runge-Kutta methods investigated by Milne and Rosser that compute a block of new values at each step are well-suited to vectorization. Local error estimates and continuous extensions that require no additional function evaluations are derived. A (7,8) p...
متن کاملpicoGA: A Vectorized Implementation of a Genetic Algorithm in Matlab
This document describes picoGA, our submission to the Tiny GA programming competition at GECCO 2006. picoGA is optimized to have small code size and a small memory footprint. It is implemented in the Matlab programming language. Matlab is an interpretted language that is optimized for performing operations on arrays. Loops, especially nested loops, tend to run slowly in Matlab. It is possible h...
متن کاملEfficient implementation of adaptive P1-FEM in Matlab
We provide a Matlab package p1afem for an adaptive P1-finite element method (AFEM). This includes functions for the assembly of the data, different error estimators, and an indicator-based adaptive mesh-refining algorithm. Throughout, the focus is on an efficient realization by use of Matlab built-in functions and vectorization. Numerical experiments underline the efficiency of the code which i...
متن کامل