On Freitag 26 Juni 2009, Vince Fulco wrote:
Early attempts to port over the Monte Carlo Option
supplied with the SDK and need to mod it for simple time series
bootstrapping. Not being terribly facile in C/C++ (but learning!),
could someone provide a short list of the critical components which
need to be wrapped by pycuda?
What PyCUDA can do for you is compile and execute functions marked __global__
in that sample's source code--i.e. code that runs on the GPU. Everything else
is CPU code, and making that accessible is beyond the scope of PyCUDA. If you
do want to leave that CPU code in C, there are several other packages that
might help you, ranging from Swig, Cython, Boost Python (potentially with
codepy), to ctypes.
I'm guessing that you might have the most fun if you just port the CPU control
code to Python, though--less hassle.
I am aware of the various
kernels/functions necessary from the main body of code but more
interested in a how-to in terms of referencing the ancillary functions
properly. I.E. the RNGs "MonteCarlo_SM10" and "MonteCarlo_SM13"
See above--if you want to keep those in C, use one of the packages mentioned
above (and worry about compiling them separately), or just quickly translate
them to Python. (you'll find they get a fair bit shorter :P)