Andreas, I was also just starting to look at zero-copy memory, and I
have a quick question.

First, is there a PyCUDA equivalent of (in C)
cudaSetDeviceFlags(cudaDeviceMapHost)?

Then, after creating an array with
pycuda.driver.pagelocked_empty(shape, dtype,
mem_flags=pycuda.driver.host_alloc_flags.DEVICEMAP), how exactly would
I use pycuda.driver.HostAllocation.get_device_pointer() to get me the
pointer in host memory to pass into my kernel?

I see in test_driver.py that you use Out() and In(), I tried this with
the pagelocked array above but my computation time didn't change---of
course, zero-copy memory might not be beneficial to my application
(though the suggested conditions are met: read or write only once,
fully coalesced). But I wonder if Out() and In() are copying the
arrays between device memory or if they're actually using the host
pagelocked memory?

Thanks for any hints. Once I get this working, I'll submit a test for
test_driver.py that verifies zero-copy memory if there's interest.

Ahmed

On Tue, Aug 4, 2009 at 12:34 AM, Andreas
Klöckner<[email protected]> wrote:
> On Montag 03 August 2009, WesLee Frisby wrote:
>> Hello everyone,
>>
>> I have been using CUDA and Python/Numpy for my research. I just
>> recently came across PyCUDA. I am currently wondering if PyCUDA has
>> support to create Numpy arrays that use pinned memory allocated by
>> cudaMallocHost() as storage. Is such a thing available in PyCUDA? I
>> looked through the documentation but didn't see anything that was what
>> I was looking for. Anyways, I came across this page
>> http://blog.enthought.com/?p=62 on how to create a custom Python Type
>> that will allow Numpy to use different allocators besides malloc. If
>> this hasn't been done I'm willing to write the necessary code to get
>> this to work. Let me know what you all think. -- Maybe I should be
>> asking the numpy list too.
>
> http://documen.tician.de/pycuda/driver.html#pycuda.driver.pagelocked_empty
>
> :)
>
> Andreas
>
> _______________________________________________
> PyCUDA mailing list
> [email protected]
> http://tiker.net/mailman/listinfo/pycuda_tiker.net
>
>

_______________________________________________
PyCUDA mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net

Reply via email to