[ADMB Users] A nontrivial cuda example

dave fournier davef at otter-rsch.com
Wed Sep 14 13:13:20 PDT 2011


As Chris anticipated (ruining my surprise) I figured out that difficulty 
in understanding
derivative stuff might be holding up some of the parallel processing so I
took a few hours to write an example of GPU processing within ADMB.

Here is a vectorized log_negative binomial density example.  It is a 
rather silly
negative binomial regression, but it does call the log_negative_binomial 
density function
a lot of times.  I has to do forward AD for functions of one or two 
variables in C
rather than C++
which means you put in the AD code rather than overloading the operators.

It runs on the GPU or CPU depending on whether you enter 1 or 2 when 
prompted.

The example shows how to calculate the derivatives and how to make sure 
they are correct.

I hope we can all build on this to clean up the GPU interface and move 
it to opencl.
the current version is cuda.

In order to build the example I used the makefile from the cuda sdk examples
modified to include the admb stuff.  The cpp file was renamed to a cu file
'cause cuda seems to like that.

It should run a lot faster on Chris's  fancy government thing.

Have fun,

         Dave
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: opencl_example.txt
URL: <http://lists.admb-project.org/pipermail/users/attachments/20110914/dd712b4a/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cudavectornb.tpl
URL: <http://lists.admb-project.org/pipermail/users/attachments/20110914/dd712b4a/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cudavectornb.zip
Type: application/zip
Size: 9660 bytes
Desc: not available
URL: <http://lists.admb-project.org/pipermail/users/attachments/20110914/dd712b4a/attachment.zip>


More information about the Users mailing list