Embedded coder loop vectorization

1 次查看(过去 30 天)
We're using embedded coder to target an ADI SHARC processor and looking to optimize execution speed.
When compiling the generated code with VisualDSP++, the compiler warns:
cc1434: {D} warning: loop would vectorize if alignment were known - consider inserting vector_for pragma if all memory accesses are aligned on even-word boundaries
Where it makes sense, these loops can be vectorized by manually inserting a #pragma vector_for before the associated for().
Is there a way to get embedded coder to automatically insert these types of pragmas into the generated code?
Thanks for any help! Jonathan

回答(1 个)

Mark McBroom
Mark McBroom 2018-3-11
I am not aware of a way to insert these pragmas. However, you might want to investigate using the Code Replacement Library feature. With this feature, you can have the code generator replace standard math operations with optimized library functions provided by your vendor. For example, you could instruct the code generator to replace all matrix addition operations with a call to the function matadd() described in the VisualDSP++ Run Time Library .

类别

Help CenterFile Exchange 中查找有关 Simulink Coder 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by