<p style="text-align: justify;">The numerical inversion of the Laplace transform is a long standing problem due its implicit ill-posedness. Patrick Kano and Moysey Brio of <a href="http://www.acunum.com/">Acunum Algorithms and Simulations</a>, with their experience in computational methods and algorithm development, found a solution that not only works, but is very fast.</p>
<p style="text-align: justify;">Their code implements the Weeks' method for Numerical Laplace Inversion. Apart from casting CPU variables to GPU, etc, the major step involved in Jacketizing the code was as simple as converting a for loop to <a href="http://wiki.accelereyes.com/wiki/index.php/GFOR_Usage">GFOR</a>! Something like what's given below:</p>

<pre>for nidx=1:Nprod
  Errorvec(nidx) = wfncpuErrorEst( ... );
end</pre>
<pre>gfor nidx=1:Nprod
  Errorvec(nidx) = wfnjacErrorEst( ... );
gend</pre>
<p style="text-align: justify;">The loop in question calls a global minimization function that computes an absolute error estimate for each pair of parameter values in parallel.</p>


[caption id="attachment_1322" align="aligncenter" width="544" caption="Wrapped Weeks CPU Runtime: 28 s"]<a href="http://blog.accelereyes.com/blog/wp-content/uploads/2011/05/D_12.jpg"><img class="size-large wp-image-1322 " title="Wrapped Weeks CPU Local Search" src="http://blog.accelereyes.com/blog/wp-content/uploads/2011/05/D_12-1024x768.jpg" alt="" width="544" height="407" /></a>[/caption]

[caption id="attachment_1317" align="aligncenter" width="546" caption="Wrapped Weeks GPU Runtime: 7.48 s"]<a href="http://blog.accelereyes.com/blog/wp-content/uploads/2011/05/D_2.jpg"><img class="size-large wp-image-1317" title="Wrapped Weeks Method: GPU Global Search" src="http://blog.accelereyes.com/blog/wp-content/uploads/2011/05/D_2-1024x768.jpg" alt="" width="546" height="406" /></a>[/caption]
<p style="text-align: justify;">The system used to run timings was a Debian Linux machine with a Tesla C2070 GPU, MATLAB 2010b, and Jacket 1.6.</p>
<p style="text-align: justify;">With Jacket 1.7 and above, it would be interesting to try and optimize this application further. One suggestion from our side would be to explore if it is possible to maintain just one function, wfnErrorEst, that works on both CPU and GPU inputs (this technique is discussed in <a title="Write Once, Run Everywhere" href="http://blog.accelereyes.com/blog/2011/03/17/write_once_run_everywhere/">this blog post</a>).</p>
<p style="text-align: justify;">The full code can be downloaded <a href="http://blog.accelereyes.com/blog/wp-content/uploads/2011/05/WEEKS_METHOD_Exchange_April4.zip">here</a>. It provides example images, instructions as well as speedup figures.</p>
<p style="text-align: justify;">We thank Patrick Kano and Moysey Brio for their efforts in tackling this tough problem and finding a solution that uses GPU computing with Jacket.</p>