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 the gpuArray (Parallel Computing Toolbox) function to transfer data to the GPU and then call the gather (Parallel Computing Toolbox) function to retrieve the output data from the GPU. For a list of Audio Toolbox functions that support execution on GPUs, see Function List (gpuArray support). 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, see Function List (C/C++ Code Generation). You need MATLAB Coder™ to generate C/C++ code.

GPU Code Generation.  After you develop your application, you can generate optimized CUDA® code for NVIDIA® GPUs from MATLAB code. The code can be integrated 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, see Function List (GPU Code Generation). You need MATLAB Coder and GPU Coder™ to generate CUDA code.

Apps

MATLAB CoderGenerate C code or MEX function from MATLAB code
GPU CoderGenerate GPU code from MATLAB code

Functions

gpuArrayArray stored on GPU
gatherTransfer distributed array, Composite object, or gpuArray object to local workspace
codegenGenerate C/C++ code from MATLAB code

Topics

GPU Code Acceleration

Code Generation

Featured Examples