[PyCUDA] simple question about PyCuda

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PyCUDA] simple question about PyCuda

Davide Bassano

Dear Mr/Mrs

 

I have just started working with PyCuda and I have a simple question: how can I parallel a Python code if PyCuda wants a kernel written in C?

 

Let me clarify: I have a Python code (with classes and other things all suitable with Python and unsuitable with C). I have 256 independent for loops that I want to parallelize. These loops contain Python code that can’t be translated to C. So I tried using PyCuda package but it turned out that the kernel must be written in C.

 

How can I parallelize an actual Python code with PyCuda package without translating my code to C?


Thanks, 

Best regards,

 

Davide Bassano


_______________________________________________
PyCUDA mailing list
[hidden email]
https://lists.tiker.net/listinfo/pycuda
Reply | Threaded
Open this post in threaded view
|

Re: simple question about PyCuda

Andreas Kloeckner
Davide Bassano <[hidden email]> writes:

> Dear Mr/Mrs
>
>
>
> I have just started working with PyCuda and I have a simple question: how
> can I parallel a Python code if PyCuda wants a kernel written in C?
>
>
>
> Let me clarify: I have a Python code (with classes and other things all
> suitable with Python and unsuitable with C). I have 256 independent for
> loops that I want to parallelize. These loops contain Python code that
> can’t be translated to C. So I tried using PyCuda package but it turned out
> that the kernel must be written in C.
>
> How can I parallelize an actual Python code with PyCuda package without
> translating my code to C?
You could try using the gpuarray functionality built into PyCUDA. Some
numpy-based codes can be effectively made GPU-aware through it.

Andreas

_______________________________________________
PyCUDA mailing list
[hidden email]
https://lists.tiker.net/listinfo/pycuda

signature.asc (847 bytes) Download Attachment