File Exchange

image thumbnail


version (22.5 KB) by Paul Peeling
Solving Large Geometric and Visualization Problems with GPU Computing in MATLAB


Updated 01 Sep 2016

View License

It is often necessary to scale a technical computing problem involving a small amount of data to a much larger data set. Simply looping over each section of the data can become a computational bottleneck, especially if the application has to run in real time. MATLAB® offers several approaches for accelerating algorithms, including performing computations in parallel on multicore processors and GPUs. If you have an NVDIA GPU available, one approach is to leverage the parallel architecture and throughput of the GPU with Parallel Computing Toolbox TM. Certain classes of problems, especially in computational geometry and visualization, can be solved very efficiently on a GPU.
In this submission we will modify an algorithm to run on a GPU, and then solve a geometric problem involving millions of lines and shapes in under a second. We illustrate this approach using the problem of tracing light rays as they intersect with objects. This type of problem is present in a variety of applications, including scene rendering and medical imaging.
This code accompanies the article "Solving Large Geometric and Visualization Problems with GPU Computing in MATLAB" (

Cite As

Paul Peeling (2020). (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

the motive for the upload is so much of my taste.
i like the compilation

Probably one can explain it like this:
As long as the algorithm calls the loop with less elements then available cores the execution time is not increasing with the number of elements.

A question about the article: why is it, that the curve characterizing the GPU implementation is not monotonically increasing?


Updated license

Corrected order of legend entries when running the benchmark scripts. Thanks to Vadim Bulitko for spotting this.
Added a high-resolution PDF version of the execution time comparison plots.

Added link to article.

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux