Hi Andreas,

Thank you, that's what I was missing (now that I think about it, this
requirement seems perfectly logical). Probably, it is worth adding
something about it to reference entry for
pycuda.driver.memcpy_htod_async().

Best regards,
Bogdan

On Sun, Oct 17, 2010 at 9:37 AM, Andreas Kloeckner
<li...@informa.tiker.net> wrote:
> On Sun, 3 Oct 2010 01:44:35 +1000, Bogdan Opanchuk <manti...@gmail.com> wrote:
>> Hello all,
>>
>> I am getting LogicError from gpuarray.to_gpu_async() for some reason. Code:
>
> Any host memory involved in *_async() must be page-locked. FTFY:
>
> import pycuda.autoinit
> import pycuda.driver as drv
> import pycuda.gpuarray as gpuarray
> import numpy
>
> a = numpy.random.randn(400).astype(numpy.float32)
> a2 = drv.pagelocked_empty_like(a)
> a2[:] = a
> stream = drv.Stream()
> a_gpu = gpuarray.to_gpu_async(a2, stream=stream)
>
> Andreas
>

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to