Main Content

Code Generation and Acceleration Support

Generate C code from MATLAB®code and Simulink®, and use GPUs to accelerate processing

You can generate C code from your MATLAB and Simulink model designs. Some Communications Toolbox™ blocks and System objects provide support for C code generation when you use them withMATLAB Coder™。您可以在原型设计时加快代码,通信工具箱包括可以在图形处理单元(GPU)上执行的一些功能。

C/C++ Code Generation.开发应用程序后,您可以从Matlab代码和Simulink模型生成便携式C / C ++源代码,独立的可执行文件或独立应用程序。金宝appC / C ++代码生成使您可以在没有MATLAB的计算机上运行模拟,并在您在MATLAB工作时加速处理。有关支持C / C ++代码生成的通信工具箱功能列表,请参阅金宝appFunctions and System Objects Supporting C Code Generation。You needMATLAB Coderto generate C/C++ code. For more information, see从MATLAB代码生成C代码Video

GPU Code Acceleration.为了在原型设计时加快代码,通信工具箱包含可以在图形处理单元(GPU)上执行的一些功能。你可以使用gpuArray(Parallel Computing Toolbox)function to transfer data to the GPU and then call thegather(Parallel Computing Toolbox)function to retrieve the output data from the GPU. For a list of Communications Toolbox features that support GPU code generation, seeGPU Arrays Support List for System Objects。You need Parallel Computing Toolbox™ to enable GPU support.

Apps

MATLAB Coder Generate C code or MEX function fromMATLABcode

Functions

codegen Generate C/C++ code fromMATLABcode
gather Transfer distributed array or gpuArray to local workspace
gpuArray Array stored on GPU

话题