Hi John,

Zhe Weng <[email protected]> writes:
> 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.

1) You can just say SourceModule(open("swap.h", "r").read()) to read in
your kernel.

2) You'll have to use the "include_dirs" parameter to SourceModule.

http://documen.tician.de/pycuda/driver.html#pycuda.compiler.SourceModule

Andreas

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to