SIMD 代码生成
您可以从 DSP System Toolbox 中的某些算法生成 SIMD 代码,例如计算密集型的 FIR 滤波器和 LMS 滤波器。SIMD 固有函数可显著提高从这些算法生成的代码的性能,在大多数情况下能够满足或超出仿真性能。SIMD 是一种计算范式,在该范式下,一条指令可处理多种数据。许多现代处理器都有 SIMD 指令,例如,一次执行多次加法或乘法运算的 SIMD 指令。
您可以使用 DSP Intel AVX2-FMA
代码替换库(仅适用于 AVX2 平台)或使用模型配置参数利用目标硬件指令集扩展(适用于 Apple 处理器、ARM® Cortex®-A 处理器以及所有 Intel® 平台)来生成 SIMD 代码。
要从 MATLAB® System object 生成 SIMD 代码,您需要 MATLAB Coder™ 和 Embedded Coder®。要使用 Intel AVX2 代码替换库从 Simulink® 模块生成 SIMD 代码,您需要 Embedded Coder。要使用模型配置参数利用目标硬件指令集扩展从 Simulink 模块生成 SIMD 代码,您需要 Simulink Coder 或 Embedded Coder。
主题
- System objects in DSP System Toolbox that Support SIMD Code Generation
List of System objects that support SIMD code generation.
- Simulink Blocks in DSP System Toolbox that Support SIMD Code Generation
List of Simulink blocks in DSP System Toolbox that support SIMD code generation.
- Use Intel AVX2 Code Replacement Library to Generate SIMD Code from MATLAB Algorithms
Generate high performance SIMD Code from MATLAB algorithms in DSP System Toolbox using Intel AVX2 code replacement library.
- Use Intel AVX2 Code Replacement Library to Generate SIMD Code from Simulink Blocks
Generate high performance SIMD code from Simulink blocks in DSP System Toolbox using Intel AVX2 code replacement library.
- Use Target Hardware Instruction Set Extensions to Generate SIMD Code from Simulink Blocks for Intel Platforms
Generate high performance SIMD Code from Simulink Blocks in DSP System Toolbox by using the Leverage target hardware instruction set extensions model configuration parameter.
- Use Target Hardware Instruction Set Extensions to Generate SIMD Code from Simulink Blocks for Apple silicon
Generate high performance SIMD Code from Simulink Blocks in DSP System Toolbox by using the ARM Neon technology for Apple silicon platforms.
- Use Target Hardware Instruction Set Extensions to Generate SIMD Code from Simulink Blocks for ARM Cortex-A Processors
Generate high performance SIMD Code from Simulink Blocks in DSP System Toolbox by using the Embedded Coder Support Package for ARM Cortex-A Processors.