Hi,

Although this is the PyCuda mailing list and my question is more related to CodePy, I think I could find some clarifications here. While reading about CodePy, I came across this sentence: "In particular, the code generation facilities work well in conjunction with PyCuda" [1]. So I had a look on PyCuda and I did not yet find the advantages in the combination of CodePy and PyCuda while the general idea on using RTCG in GPU programming is quite clear. Also the internal structure of PyCuda seems clear to me with a C++ Wrapper for CUDA and the usage of Boost-Python to expose the C++ functions of the Wrapper to Python. But back on CodePy. I have some hints but in neither explanation I do get the point:

Hint 1
I studied the paper [2] where the advantage of RTCG for GPU programming is explained. There is also a section about the code generation with CodePy compared to generating code with a templating engine. Both example do produce the same target code and I do not get the point in which situation the syntax tree variant is more appropriate, or actually needed? Does someone have an example?

Hint 2
It is the GenerableStruct node on [3]. Can I see it as a help to minimise my knowledge about the hardware architecture of a GPU while programming for the GPU?

Hint 3
I can also imagine a way of assembling the 'nodes' BoostPythonModule, CudaGlobal and CudaModule from CodePy to generate host code and a CUDA Kernel at runtime, and also launch the CUDA Kernel afterwards still at runtime. But this process seems rather complicated to me since PyCuda offers the possibiliy of doing the host code part (allocating memory on GPU, copying data to and from the GPU and free the memory) within python with the advantage of not beeing responsible on freeing the resource. Or is there any situation where the described way could be the only solution?


thanks for the clarification
martin


[1] http://mathema.tician.de/software/codepy
[2] http://www.dam.brown.edu/scicomp/reports/2009-40/
[3] http://documen.tician.de/codepy/cgen.html#codepy.cgen.GenerableStruct

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to