Dear Graham,

Graham Mills <[email protected]> writes:
> Thanks for the quick reply.I was able to track that problem down to a syntax 
> error, but I've run into a problem launching kernels on gpu arrays allocated 
> from the device memory pool, as in the following code:
>
> import numpy
> import pycuda.autoinit
> import pycuda.gpuarray as gpua
> from pycuda.tools import DeviceMemoryPool as DMP
>
> pool=DMP()
>
> test=gpua.GPUArray((1,2),dtype=numpy.float32,allocator=pool.allocate)
>
> print(test)
>
> # [[ nan  nan]]
>
> print( int( test.gpudata))
>
> # 30066083328
>
> print( test.allocator)
>
> # <bound method DeviceMemoryPool.allocate of <pycuda._driver.DeviceMemoryPool 
> object at 0x2909e68>>
>
> # attempting to launch a kernel returns an error
> test.fill(3.)
>
>
> The error I get is as follows (depending on the kernel and the way it is 
> launched)
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File 
> "/usr/local/lib/python3.2/dist-packages/pycuda-2013.1.1-py3.2-linux-x86_64.egg/pycuda/gpuarray.py",
>  line 516, in fill
>     value, self.gpudata, self.mem_size)
>   File 
> "/usr/local/lib/python3.2/dist-packages/pycuda-2013.1.1-py3.2-linux-x86_64.egg/pycuda/driver.py",
>  line 475, in function_prepared_async_call
>     arg_buf = pack(func.arg_format, *args)
> struct.error: required argument is not an integer
>
>
> Manually specifying the allocator in the same way with 
> pycuda.driver.mem_alloc seems to work fine, though. Do you know what it might 
> be?

Sorry for the extremely belated reply, but for the record, I am unable
to reproduce this issue.

Andreas

Attachment: pgpTwl1wO4Yq7.pgp
Description: PGP signature

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to