[ADMB Users] A nontrivial cuda example

CHRIS GRANDIN cgrandin at shaw.ca
Wed Sep 14 13:52:32 PDT 2011


Thank you very much Dave, I will work to convert this to opencl, as I already have the opencl library included into the admb source build steps it shouldn't be too big a deal.  I knew we needed to change the operator overloading to structs but figured it was too much work, i.e. rewriting all the overloads in admb... I was kinda hoping opencl would come out with a C++-friendly library..
Chris

----- Original Message -----
From: dave fournier <davef at otter-rsch.com>
Date: Wednesday, September 14, 2011 1:13 pm
Subject: A nontrivial cuda example
To: CHRIS GRANDIN <cgrandin at shaw.ca>
Cc: users at admb-project.org

> 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 HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20110914/b33156d8/attachment.html>


More information about the Users mailing list