MATLAB COMPILER RELEASE NOTES Guide de l'utilisateur Page 175

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 264
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 174
Optimizing Loops
6-7
Optimizing Loops
Simple Indexing
(array_indexing) T his optim ization improves the performance of simple one-
and two-dimensional array index expressions. Without this optimization, all
array indexing uses the fully general array indexing function, which is not
optimized for one- and two-dimensional indexi ng. With this optimization
enabled, indexing uses faster routines that are optimized for simple indexing.
For example,
function y = test(x,i1,i2);
y = x(i1,i2);
If you compile this with the -O none option, you get
...
mlfAssign(
&y,
mlfIndexRef(mclVsa(x, "x"), "(?,?)", mclVsa(i1, "i1"),
mclVsa(i2, "i2")));
...
Compiling wit h -O none -O array_indexing:on gives
...
mlfAssign(
&y, mclArrayRef2(mclVsa(x, "x"), mclVsa(i1, "i1"),
mclVsa(i2,"i2")));
...
The mclArrayRef2 function is optimized for two-dimensional indexing.
mclArrayRef1 is used for one-dimensional i ndexing.
Loop Simplification
(optimize_integer_for_loops) This optimization detects when a loop starts
and increments with int egers and replaces the loop with a much simpler loop
that uses C integer variables instead of array valued variables. The
performance improvements with this optimization can be dramatic.
Vue de la page 174
1 2 ... 170 171 172 173 174 175 176 177 178 179 180 ... 263 264

Commentaires sur ces manuels

Pas de commentaire