이 페이지는 기계 번역을 사용하여 번역되었습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
실행 속도
생성 코드의 실행 속도 향상
코드 생성기는 전역 변수를 지역 변수로 대체하고, 데이터 복사본을 제거하고, memset
및 memcpy
함수를 사용하고, 데이터를 저장하는 데 필요한 메모리 양을 줄이는 등의 방법으로 생성 코드의 실행 속도를 높입니다. 컴파일러와 프로세서에 맞는 최적화를 구현하고, 버퍼 재사용을 지정하고, 필요 없는 코드를 제거하면 생성된 코드의 실행 속도를 높일 수 있습니다.
도움말 항목
프로세서별 최적화
- Control Data and Function Placement in Memory by Inserting Pragmas
Increase code efficiency on your hardware by inserting pragmas in the generated code. Pragmas specify locations in memory to store data and functions. - Replace boolean with Specific Integer Data Type
Improve the execution speed of the generated code by replacing theboolean
built-in data type with a specific integer data type. - Subnormal Number Execution Speed
Minimize the possibility of execution slowdowns or overruns due to subnormal number calculation latency. - Floating-Point Multiplication to Handle a Net Slope Correction
For processors that support efficient multiplication, improve code efficiency by using floating-point multiplication to handle a net slope correction. - Optimize Generated Code Using Fixed-Point Data with Simulink, Stateflow, and MATLAB
Generate fixed-point code in Simulink®, Stateflow®, and MATLAB®. - Generate Target Optimizations Within Algorithm Code
Customize generated algorithm code with target-specific optimizations. - Generate SIMD Code from Simulink Blocks for Intel Platforms
Improve the execution speed of the generated code using Intel® SSE and Intel AVX technology. - Generate SIMD Code from Simulink Blocks for Apple silicon Platforms
Improve the execution speed of the generated code for Apple silicon platforms using ARM® Neon technology. - Optimize SIMD Code by Performing Fused Multiply Add Operations
For processors that support FMA instructions, improve execution efficiency by performing fused multiply-add operations. - Optimize Code for Reduction Operations by Using SIMD
Generate optimized code for reduction operations using SIMD instruction sets. - Set Hardware Implementation Parameters
Specify target hardware device characteristics that can be critical in embedded systems development (such as word sizes forchar
,short
,int
, andlong
data types, or desired rounding behaviors in integer operations).
실행 효율성을 개선하는 최적화
- Optimize Generated Code Using Minimum and Maximum Values
To optimize the generated code for your model, you can choose an option to use input range information, also known as design minimum and maximum, that you specify on signals and parameters. - Optimize Global Variable Usage
Choose a global variable reference optimization to satisfy your memory usage and execution speed requirements. - Improve Execution Efficiency by Reordering Block Operations in the Generated Code
The code generator can change the block execution order to improve execution efficiency. - Optimize Generated Code by Combining Multiple for Constructs
The code generator uses data dependency analysis to combinefor
constructs to reduce static code size and runtime branching. - Optimize Generated Code for Complex Signals
The code generator performs various optimizations on the structures that represent signals in the generated code. - Configure Loop Unrolling Threshold
Starting at a default value of 5, the code generator begins to use afor
loop instead of separate statements to assign values to the elements of a signal or parameter array. - Simplify Multiply Operations in Array Indexing
The code generator reduces the number of times a multiply operation executes in an array index by replacing the multiply operation with a temporary variable. - Optimize Generated Code Using memset Function
Thememset
function clears internal storage, regardless of type, to the integer bit pattern 0 (that is, all bits are off). - Use memcpy Function to Optimize Generated Code for Vector Assignments
The code generator optimizes the generated code for vector assignments by replacingfor
loops withmemcpy
function calls. - Use Conditional Input Branch Execution
For Switch and Multiport Switch blocks, Simulink executes only blocks that compute the control input and the data input that the control input selects. - Optimize Generated Code for Fixed-Point Data Operations
The code generator optimizes fixed-point operations by replacing expensive division operations with highly efficient product operations. - Control Memory Allocation for Variable-Size Arrays in a MATLAB Function Block
Disable dynamic memory allocation or specify a dynamic memory allocation threshold for MATLAB Function blocks. - Speed Up Linear Algebra in Code Generated from a MATLAB Function Block
Generate LAPACK calls for certain linear algebra functions in a MATLAB function block. Specify LAPACK library to use. - Speed Up Matrix Operations in Code Generated from a MATLAB Function Block
Generate BLAS calls for certain low-level matrix operations. Specify BLAS library to use. - Speed Up Fast Fourier Transforms in Code Generated from a MATLAB Function Block
Generate FFTW library calls for fast Fourier transforms in a MATLAB Function block. Specify the FFTW library. - Synchronize Multithreaded FFTW Planning in Code Generated from a MATLAB Function Block
Implement FFT library callback class methods and provide supporting C code to prevent concurrent access to FFTW planning. - Unroll Parallel for-Loop That Has Small Number of Iterations
Unrollparfor
-loops that have small number of iterations. - Optimize Performance of Memory Access by Using Data Alignment
Optimize the alignment of data in memory for your hardware.
Halide 코드 생성을 사용한 최적화
- Speed Up Generated Code Execution with Halide Code
Generate Halide code from Simulink models for faster array computation. - When to Use Halide Code for Efficiency
Determine when to use Halide code to provide greater execution speed. - Enhance Generated Code Performance Using Halide from a MATLAB Function Block
Generate Halide code from MATLAB Function blocks in a Simulink model for faster array computation.