You are previewing GPU Programming in MATLAB.
O'Reilly logo
GPU Programming in MATLAB

Book Description

GPU programming in MATLAB is intended for scientists, engineers, or students who develop or maintain applications in MATLAB and would like to accelerate their codes using GPU programming without losing the many benefits of MATLAB. The book starts with coverage of the Parallel Computing Toolbox and other MATLAB toolboxes for GPU computing, which allow applications to be ported straightforwardly onto GPUs without extensive knowledge of GPU programming. The next part covers built-in, GPU-enabled features of MATLAB, including options to leverage GPUs across multicore or different computer systems. Finally, advanced material includes CUDA code in MATLAB and optimizing existing GPU applications. Throughout the book, examples and source codes illustrate every concept so that readers can immediately apply them to their own development.



  • Provides in-depth, comprehensive coverage of GPUs with MATLAB, including the parallel computing toolbox and built-in features for other MATLAB toolboxes
  • Explains how to accelerate computationally heavy applications in MATLAB without the need to re-write them in another language
  • Presents case studies illustrating key concepts across multiple fields
  • Includes source code, sample datasets, and lecture slides

Table of Contents

  1. Cover image
  2. Title page
  3. Table of Contents
  4. Copyright
  5. Dedication
  6. About the Authors
  7. Foreword
  8. Preface
  9. Chapter 1: Introduction
    1. Abstract
    2. 1.1 Parallel Programming
    3. 1.2 GPU Programming
    4. 1.3 CUDA Architecture
    5. 1.4 Why GPU Programming in MATLAB? When to Use GPU Programming?
    6. 1.5 Our Approach: Organization of the Book
    7. 1.6 Chapter Review
  10. Chapter 2: Getting started
    1. Abstract
    2. Chapter Objectives
    3. 2.1 Hardware Requirements
    4. 2.2 Software Requirements
    5. 2.2.1 NVIDIA CUDA Toolkit
    6. 2.3 Chapter Review
  11. Chapter 3: Parallel Computing Toolbox
    1. Abstract
    2. 3.1 Product Description and Objectives
    3. 3.2 Parallel for-Loops (<span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="italic">parfor</span>))
    4. 3.3 Single Program Multiple Data (<span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="italic">spmd</span>))
    5. 3.4 Distributed and Codistributed Arrays
    6. 3.5 Interactive Parallel Development (<span xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" class="italic">pmode</span>))
    7. 3.6 GPU Computing
    8. 3.7 Clusters and Job Scheduling
    9. 3.8 Chapter Review
  12. Chapter 4: Introduction to GPU programming in MATLAB
    1. Abstract
    2. 4.1 GPU Programming Features in MATLAB
    3. 4.2 GPU Arrays
    4. 4.3 Built-in MATLAB Functions for GPUs
    5. 4.4 Element-Wise MATLAB Code on GPUs
    6. 4.5 Chapter Review
  13. Chapter 5: GPU programming on MATLAB toolboxes
    1. Abstract
    2. 5.1 Communications System Toolbox
    3. 5.2 Image Processing Toolbox
    4. 5.3 Neural Network Toolbox
    5. 5.4 Phased Array System Toolbox
    6. 5.5 Signal Processing Toolbox
    7. 5.6 Statistics and Machine Learning Toolbox
    8. 5.7 Chapter Review
  14. Chapter 6: Multiple GPUs
    1. Abstract
    2. 6.1 Identify and Run Code on a Specific GPU Device
    3. 6.2 Examples Using Multiple GPUs
    4. 6.3 Chapter Review
  15. Chapter 7: Run CUDA or PTX code
    1. Abstract
    2. 7.1 A Brief Introduction to CUDA C
    3. 7.2 Steps to Run CUDA or PTX Code on a GPU Through MATLAB
    4. 7.3 Example: Vector Addition
    5. 7.4 Example: Matrix Multiplication
    6. 7.5 Chapter Review
  16. Chapter 8: MATLAB MEX functions containing CUDA code
    1. Abstract
    2. 8.1 A Brief Introduction to MATLAB MEX Files
    3. 8.2 Steps to Run MATLAB MEX Functions on GPU
    4. 8.3 Example: Vector Addition
    5. 8.4 Example: Matrix Multiplication
    6. 8.5 Chapter Review
  17. Chapter 9: CUDA-accelerated libraries
    1. Abstract
    2. 9.1 Introduction
    3. 9.2 cuBLAS
    4. 9.3 cuFFT
    5. 9.4 cuRAND
    6. 9.5 cuSOLVER
    7. 9.6 cuSPARSE
    8. 9.7 NPP
    9. 9.8 Thrust
    10. 9.9 Chapter Review
  18. Chapter 10: Profiling code and improving GPU performance
    1. Abstract
    2. 10.1 MATLAB Profiling
    3. 10.2 CUDA Profiling
    4. 10.3 Best Practices for Improving GPU Performance
    5. 10.4 Chapter Review
  19. References
  20. List of Examples
  21. Index