you could use a python template engine like cheetah
http://www.cheetahtemplate.org/

and there is an example in the pycuda package
http://wiki.tiker.net/PyCuda/Examples/DemoMetaMatrixmulCheetah
look at line 28: demo_meta_matrixmul_cheetah.template.cu
that's the .cu code called

best,
Y


On Tue, Dec 4, 2012 at 11:11 PM, Zhe Weng <[email protected]> wrote:

>  Hi all,
>
> Is there any way I can edit the kernel function in .h or .cu extension
> file, which is syntax highlight, instead of editing it as a string?
>
> For example, I have a kernel called *swap(float *a, float *b, int 
> length)*stored in
> *swap.h* and implemented in *swap.cu*, and in the Python file where the
> module is like below
>  SourceModule("""
> #include"swap.h"
> """)
>
> But currently it just reports fail to find the swap.h file.
>
> Thanks!
>
> Cheers,
> John
>
> --------------------------------
> M: (+61) 415786645
>
> Canberra, Australia
> Sent with Sparrow <http://www.sparrowmailapp.com/?sig>
>
>
> _______________________________________________
> PyCUDA mailing list
> [email protected]
> http://lists.tiker.net/listinfo/pycuda
>
>


-- 
Youssef Barhomi, MSc, MEng.
Research Software Engineer at the CLPS department
Brown University
T: +1 (617) 797 9929  | GMT -5:00
_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to