Main Content

Code Generation and GPU Support

Generate portable C/C++/MEX functions and use GPUs to deploy or accelerate processing

Audio Toolbox™ includes support to accelerate prototyping in MATLAB®and to generate code for deployment.

GPU Code Acceleration.To speed up your code while prototyping, Audio Toolbox includes functions that can execute on a Graphics Processing Unit (GPU). You can use thegpuArray(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 Audio Toolbox functions that support execution on GPUs, seeFunction List (gpuArraysupport). You need Parallel Computing Toolbox™ to enable GPU support.

C/C++ Code Generation.After you develop your application, you can generate portable C/C++ source code, standalone executables, or standalone applications from your MATLAB code. C/C++ code generation enables you to run your simulation on machines that do not have MATLAB installed and to speed up processing while you work in MATLAB. For a list of Audio Toolbox functions that support C/C++ code generation, seeFunction List (C/C++ Code Generation). You needMATLAB Coder™to generate C/C++ code.

GPU Code Generation.After you develop your application, you can generate optimized CUDA®code for NVIDIA®从MATLAB代码gpu。可以集成的代码into your project as source code, static libraries, or dynamic libraries, and can be used for prototyping on GPUs. You can also use the generated CUDA code within MATLAB to accelerate computationally intensive portions of your MATLAB code in machine learning, deep learning, or other applications. For a list of Audio Toolbox functions that support GPU code generation, seeFunction List (GPU Code Generation). You needMATLAB Coderand GPU Coder™ to generate CUDA code.

Apps

MATLAB Coder Generate C code or MEX function fromMATLABcode
GPU Coder Generate GPU code fromMATLABcode

Functions

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

Topics