View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
A CUDA accelerated Beam Propagation Method [BPM] Solver using the Parallel Computing Toolbox

4.5 | 2 ratings Rate this file 12 Downloads (last 30 days) File Size: 5.89 KB File ID: #29114 Version: 1.1
image thumbnail

A CUDA accelerated Beam Propagation Method [BPM] Solver using the Parallel Computing Toolbox



21 Oct 2010 (Updated )

A beam propagation method solver using the CUDA capabilities in the parallel computing toolbox.

| Watch this File

File Information

The parallel computing toolbox version 5.0 for MATLAB 2010b includes an initial capability for NVIDIA CUDA use. This entry provides a simple paraxial beam propagation method [BPM] solver that utilizes the added GPU capability. A script is also provided that runs the BPM with standard MATLAB Fourier transforms and the GPU implemented transforms. For smaller matrices, the standard MATLAB approach appears to be faster, while at larger matrices above 512x512 elements, the CUDA approach is more than twice as fast.

An effort has been made to make the program so that it will run on a computer without the parallel computing toolbox or an NVIDIA GPU. However, a comparison with standard MATLAB is only possible with those two components.


The script ScrTimeBPM.m
contains an example of how one may run the main function CUDAparaxbpm.m.
The additional files
initialize the field, update the refractive index profile, and create plots.

2) A. Weideman, Linear Dispersive Wave Equations,
3) Okamoto, K. Fundamentals of optical waveguides, Academic Press, 2000.

Required Products Parallel Computing Toolbox
MATLAB release MATLAB 7.11 (R2010b)
Other requirements An NVIDIA CUDA enabled graphics card with compute capability of at least 1.3.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
05 Nov 2010 John Melonakos

Thanks for posting this code, very cool algorithm. We've enabled it to run with Jacket and posted the results and modified code here:


23 Oct 2010 Patrick Kano

Hello David,
Thank you for your comments. My coworkers and I are interested in GPU acceleration. I was intrigued by the inclusion of CUDA capability into the MATLAB 2010b parallel computing toolbox.
The motivation for using MATLAB+CUDA was primarily my own curiosity. The choice of the beam propagation equation was based simply on my past experience with it.

From on the MathWorks website,
I do not believe that the 2009b version is adequate to run the CUDA additions.

A list of functions, like fft2, that support the GPU capability use can be found here:

Finally, a related example from the company website of fft2 being used is at:

I am glad to hear of our common interest.

Comment only
22 Oct 2010 David Romero-Antequera

Hello, Patrick. It is quite a coincidence that I am working in this same subject (kind of). I do not have, however, the latest Parallel Computing Toolbox (PCTB) and I would like to do some questions. Do you choose to use CUDA over standard parallel computing (multicore) by any particular reason? Is the FFT2 parallelized in the new version of PCTB (as far as I know, I'm my version it is only parallelized 1D FFT)? I am using 2009b, by the way. Thanks!

23 Oct 2010 1.1

We slightly modified the description to explain more about the functions.

Contact us