Discussion:
[PyCUDA] prepare function arguments
Ananth Sridharan
2015-04-19 05:32:55 UTC
Permalink
Can someone shed some light on the arguments for the "prepare" used by
pycuda? I have been unable to find a set of examples to help understand
what the arguments are supposed to look like.

On the official website,
http://documen.tician.de/pycuda/tutorial.html?highlight=prepare
what does the argument "P" stand for? In another example, I found someone
using "PiPi" - what is the prepare statement supposed to be for, say, a
kernel that looks like this..

__global__ dosomething(float *a, double *b, float *c, int nmax)

is it supposed to be func.prepare("fdfi"), or did I not understand the
concept correctly?
Andreas Kloeckner
2015-04-19 16:23:07 UTC
Permalink
Post by Ananth Sridharan
Can someone shed some light on the arguments for the "prepare" used by
pycuda? I have been unable to find a set of examples to help understand
what the arguments are supposed to look like.
On the official website,
http://documen.tician.de/pycuda/tutorial.html?highlight=prepare
what does the argument "P" stand for? In another example, I found someone
using "PiPi" - what is the prepare statement supposed to be for, say, a
kernel that looks like this..
__global__ dosomething(float *a, double *b, float *c, int nmax)
is it supposed to be func.prepare("fdfi"), or did I not understand the
concept correctly?
This page defines the format:

https://docs.python.org/2/library/struct.html

Andreas
Ananth Sridharan
2015-04-20 13:57:33 UTC
Permalink
Got it from struct module documentation and
http://wiki.tiker.net/PyCuda/FrequentlyAskedQuestions

Pointers (to anything - single integers/float/double, arrays) should be "P"
integer is " i ",
float is " f ",
double is " d ",
...
The example I asked about should then have "PPPi".

Thanks!
Ananth
Post by Andreas Kloeckner
Post by Ananth Sridharan
Can someone shed some light on the arguments for the "prepare" used by
pycuda? I have been unable to find a set of examples to help understand
what the arguments are supposed to look like.
On the official website,
http://documen.tician.de/pycuda/tutorial.html?highlight=prepare
what does the argument "P" stand for? In another example, I found someone
using "PiPi" - what is the prepare statement supposed to be for, say, a
kernel that looks like this..
__global__ dosomething(float *a, double *b, float *c, int nmax)
is it supposed to be func.prepare("fdfi"), or did I not understand the
concept correctly?
https://docs.python.org/2/library/struct.html
Andreas
Loading...