[PyCUDA] wrapping existing device pointer for use with pycuda

2013-09-27 Thread Sam Preston
Hi all, I would like to use pycuda to write a few kernels to interoperate with a larger cuda/python library I'm already using. I can get the raw device memory address as a python int, and from searching past threads on the mailing list it sounds like I should be able to pass this as an argument

Re: [PyCUDA] wrapping existing device pointer for use with pycuda

2013-09-27 Thread Andreas Kloeckner
Sam Preston j...@sci.utah.edu writes: Hi all, I would like to use pycuda to write a few kernels to interoperate with a larger cuda/python library I'm already using. I can get the raw device memory address as a python int, and from searching past threads on the mailing list it sounds like I

Re: [PyCUDA] wrapping existing device pointer for use with pycuda

2013-09-27 Thread Sam Preston
Ah, indeed after some more debugging it turns out that the error was being caused by my `grid' argument -- the entries were floats (should have been cast to int), and were causing the exception. For anyone interested, here's a simple working example (using only pycuda) of passing in an int: