Dnia 2011-05-06, pią o godzinie 08:30 -0400, Andreas Kloeckner pisze:
On Fri, 06 May 2011 11:00:08 +0200, Tomasz Rybak
> Dnia 2011-04-24, nie o godzinie 17:50 +0200, Tomasz Rybak pisze:
> > Dnia 2011-04-24, nie o godzinie 01:22 -0400, Andreas Kloeckner pisze:
> > > On Sun, 17 Apr 2011 17:10:30 +0200,
"=?UTF-8?B?VG9tYXN6IFJ5YmFr?=" <bogomips(a)post.pl> wrote:
> > > > Dnia 2011-04-16 00:48 Andreas Kloeckner napisał(a):
> > > >
> > > > >Hi Tomasz,
> > > > >
> > > > >any progress on the things below? Has maybe another email gone
> > > > >I'd like to release PyCUDA 2011.1 soon.
> > > >
> > > >
> > > > I have send the patch to the mailing list on 2011-03-18 and
> > > > Please check the archives.
> > >
> > > Weird. I'm really not sure what happened there--I could've sworn I
> > > saw these emails.
> > >
> > > In any case, I've merged your patch into the
> > > curand-wrapper-v2-from-tomasz branch, which I've also brought up to
> > > current master.
> > Thanks!
> > >
> > > Looks like we're almost done here--only initialization is missing.
> > I hope to have it done by the end of the next week.
> I have troubles with transferring data between C and Python.
> I want to:
> 1. call curandGetDirectionVectors32 which returns pointer
> to the 32 int32
> 2. transfer this data to the device memory
> 3. create GPUArray from it
> 4. call prepare() kernel which will pass appropriate
> direction vectors to the curand_init() kernel
> I have tried two approaches (curand-hostptr.diff
> and curand-memcpy.diff). The former, when compiled,
> causes _curand module to misbehave - e.g. it get_curand_version()
> returns None instead of (3, 2, 0) or (0, 0, 0)
> The latter compiles but cuMemcpy call fails because of
> parameter type mismatch.
> Can someone give me some direction how to transfer raw
> pointer from C to Python?
What's wrong with creating a numpy array for the data?
Thanks for the tip.
Here is the patch. It works, and generates
quasi-random numbers. The only problem is when
with calling curandGetDirectionVectors - it generates
only 20000 vectors, so we will have repeated generators
when we have GPUs with more than 20000 cores ;-)
BTW - there is difference in wrap_cudadrv.cpp between
master and curand branch. I had to fix it but
did not include this change in the patch.
Please apply this patch - and I believe
that we could think about merging curand branch
Tomasz Rybak <bogomips(a)post.pl> GPG/PGP key ID: 2AD5 9860
Fingerprint A481 824E 7DD3 9C0E C40A 488E C654 FB33 2AD5 9860