I cant seem to get it to work, i seem to get a context conflict.

  File "C:\Python27\lib\site-packages\pycuda\driver.py", line 188, in
function_call
    Context.synchronize()
pycuda._driver.Error: cuCtxSynchronize failed: unknown
PyCUDA WARNING: a clean-up operation failed (dead context maybe?)
cuMemFree failed: unknown
PyCUDA WARNING: a clean-up operation failed (dead context maybe?)
cuModuleUnload failed: unknown

-Tai

On Tue, Apr 3, 2012 at 11:13 AM, Kin Trinh <[email protected]> wrote:

> Thanks!
>
> I'll try it when i get off work.
>
> So i dont have to wrap it in som pretty object, just pass the adress as an
> int and it will work
>
> -Tai
>
>
> On Tue, Apr 3, 2012 at 8:05 AM, Andreas Kloeckner <[email protected]
> > wrote:
>
>> <#part sign=pgpmime>
>> On Mon, 2 Apr 2012 23:44:08 +0200, Kin Trinh <[email protected]>
>> wrote:
>> > # how would i go about making this work
>> > # i have written my own wrapper for cublas and want to pass my device
>> > pointers to pycuda
>> >
>> > # example psudo code
>> >
>> > ...
>> >
>> > mod = SourceModule("""
>> > __global__ void multiply_them(float *dest, float *a, float *b)
>> > {
>> >   const int i = threadIdx.x;
>> >   dest[i] = a[i] * b[i] + 2;
>> > }
>> > """)
>> >
>> > multiply_them = mod.get_function("multiply_them")
>> >
>> > # cudaMalloc()
>> > # A is a LP_c_float
>> >
>> > B = numpy.mat(numpy.ones((2, 2)), numpy.float32)
>> >
>> > # i just want to be able to pass my pointers along somehow...
>> > multiply_them( drv.Out(B), A, A, block=(4,1,1), grid=(1,1))
>>
>> PyCUDA takes integers wherever it wants device pointers--so as long as
>> you can turn your ctypes type into an int, you should be good to go.
>>
>> Andreas
>>
>>
>
_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to