Computación GPU en MATLAB
Acelere su código ejecutando funciones MATLAB® en una GPU
Si todas las funciones que desea utilizar son compatibles con la GPU, simplemente puede usar gpuArray para transferir datos de entrada a la GPU. Para comenzar con la computación GPU, consulte Run MATLAB Functions on a GPU.
Para el aprendizaje profundo, MATLAB proporciona soporte paralelo automático para múltiples GPU. Ver Deep Learning with MATLAB on Multiple GPUs (Deep Learning Toolbox).
Puede usar la función gpuDevice para inspeccionar y seleccionar su GPU y usar las funciones gpuDeviceTable para inspeccionar varias GPU.
Funciones
Temas
Ejecute el código MATLAB en la GPU
- Run MATLAB Functions on a GPU
Supply agpuArrayargument to automatically run functions on a GPU. - Identify and Select a GPU Device
This example shows how to usegpuDeviceto identify and select which device you want to use. - GPU Computing Requirements
Support for NVIDIA® GPU architectures. - Establish Arrays on a GPU
UsegpuArrayobjects to store data on the GPU and perform calculation on the GPU. - Run MATLAB Functions on Multiple GPUs
This example shows how to run MATLAB® code on multiple GPUs in parallel, first on your local machine, then scaling up to a cluster. - Work with Remote GPUs
This example shows how to run MATLAB® code on multiple remote GPUs in a cluster. (Desde R2024a) - Run MATLAB Using GPUs in the Cloud
Take advantage of powerful GPUs in the cloud to accelerate your code. - Train Network Using Automatic Multi-GPU Support (Deep Learning Toolbox)
This example shows how to use multiple GPUs on your local machine for deep learning training using automatic parallel support. - Work with Sparse Arrays on a GPU
Learn about the conditions for working with sparse arrays on a GPU. - Work with Complex Numbers on a GPU
Learn about the conditions for applying functions that might return complex values on a GPU.
Mejorar el rendimiento en GPU
- Measure and Improve GPU Performance
Time code running on your GPU and explore options for improving performance. - Improve Performance Using a GPU and Vectorized Calculations
This example shows you how to improve performance by running a function on the GPU instead of the CPU, and by vectorizing the calculations. - Improve Performance of Element-Wise MATLAB Functions on the GPU Using arrayfun
This example shows how to improve the performance of your code by running MATLAB® functions on the GPU usingarrayfun. - Improve Performance of Small Matrix Problems on the GPU Using pagefun
This example shows how to usepagefunto improve the performance of independent operations applied to multiple matrices arranged in a multidimensional array. - Benchmarking A\b on the GPU
This example looks at how we can benchmark the solving of a linear system on the GPU.
Aprende más
- Perfilar código para mejorar el rendimiento
Utilice Profiler para medir cuánto tiempo lleva ejecutar código e identificar qué líneas de código consumen la mayor parte del tiempo o qué líneas no se ejecutan. - Vectorización
Revise el código basado en bucles y orientado a escalares para usar las operaciones matriciales y vectoriales de MATLAB. - Random Number Streams on a GPU
Control the random number streams on a GPU to generate the same sequences of random numbers as on the CPU. - Generating Random Numbers on a GPU
This example shows how to switch between the different random number generators that are supported on the GPU. - Stencil Operations on a GPU
This example uses Conway's "Game of Life" to demonstrate how stencil operations can be performed using a GPU. - Compute the Mandelbrot Set Using GPU-Enabled Functions
This example shows how to use GPU-enabled MATLAB® functions to compute a well-known mathematical construction: the Mandelbrot set.




