Embedded coder loop vectorization

조회 수: 1 (최근 30일)
Jonathan Horne
Jonathan Horne 2018년 3월 6일
답변: Mark McBroom 2018년 3월 11일
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