Complex math on GPU v CPU
1 view (last 30 days)
Show older comments
I am using complex step derivatives to compute gradients of an otherwise real and analytic function, but I get different answers when running the exact same code on the GPU as on the CPU. Most differences are small (<.1%), but some can be off by more than a factor of 2. All GPU computations are done using double precision on a GTX 580 running 2012a.
When I use John D'Errico's DERIVEST to compute the same thing using real finite differences (awesome program by the way) CPU and GPU produce pretty much identical answers. Is there some subtle difference in the way the GPU handles complex numbers that would cause this?
Thanks, Rodrigo
0 Comments
Answers (1)
Andy
on 24 Sep 2012
hello Rodrigo,
first, thanks for trying the MathWorks GPU offering.
the GPU math library has been written to give results as close to the CPU as reasonably possible. most functions and arithmetic operators are off only a couple ulps. your comments/questions are somewhat surprising. would you mind posting some more details such as example code with inputs? also what OS are you using to run CPU MATLAB?
thanks,
Andy
.
See Also
Categories
Find more on GPU Computing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!