View License

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

» Watch video

Highlights from
GPU vs CPU speed test of finite difference equation

4.5 | 2 ratings Rate this file 7 Downloads (last 30 days) File Size: 5.73 KB File ID: #42779 Version: 1.6

GPU vs CPU speed test of finite difference equation



22 Jul 2013 (Updated )

Compares the speed of the parallel computing toolbox functions vs CPU for finite difference

| Watch this File

File Information

Simulates the heat equation, with constant heat capacity and thermal conductivity, using GPU (parallel computing toolbox) or CPU (matrix calculations). Includes results from Nvidia titan and i5-2500k @ 4.2 GHz. Any suggestions welcome on speeding up either.

Required Products Parallel Computing Toolbox
MATLAB release MATLAB 8.3 (R2014a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
09 Dec 2016 Bill R.

28 Aug 2014 Christopher

Probably it would be useful to say somewhere in the comments that the variable myPerf is reporting "speed", i.e. something proportional to the number of operations divided by the time.

But definitely useful. Thanks for posting the code!

10 Jul 2014 Mark Ward

GPU with the stencil method is definitely faster, by around 25x on an NVidia Titan compared with i7-3770 @ 3.4 GHz for single precision

Comment only
10 Jul 2014 Mark Ward

Updated version uses less memeory and is faster, and has comments explaining how to run on the cpu or the gpu in two different ways. Some options have to be changed by editing the code, e.g. whether the calculations are single or double precision etc.

Comment only
09 Jun 2014 asan masraf

you applied different loops on GPU but
where is CPU processing part on these are codes.(I can't see!)
and from your results appear cpu faster than gpu! is it right or I misunderstood ??!

Comment only
29 Jul 2013 1.2

Was advised by Mathworks that one of the submitted files was not a .m file, so I've re-submitted the zip archive.

10 Jul 2014 1.3

This version is faster and uses less memory. It uses the 'stencil' approach: see the comments for details.

10 Jul 2014 1.4

I temporarily uploaded a version which used massive arrays. This one is back to normal.

10 Jul 2014 1.5

few more minor corrections. All the big calculations are set as single precision currently.

10 Jul 2014 1.6

more minor fixes

Contact us